Hi, I have a site on a linux server, php works fine, but for seo reasons, I still have .asp pages. I have them because I used "AddType text/html asp" to my htaccess file. The problem is that the server isn't parsing the PHP code when it sees the page with the .asp extension. Is there a way to tell the server to check all .asp pages for PHP code? I want to add a script to every page on the site so all .asp pages will have the code. Thanks, James...
Argh, you're not one of those people who lets search engines dictate how you build your site are you? I'll tell you the best solution that I can think of: Since you're on Linux, and I assume using Apache: use mod_rewrite to make semantic URLs. These have no file extensions, so you avoid running into this kind of issue in the future. Use RewriteRule to do this. So that old links to .asp pages still work, use RedirectMatch to redirect to your new semantic URLs. That way, everyone should be happy.
Huh. I've never heard of search engines preferring ASP pages. Is this true and if so, what's the reason for it??
Jestep: I tried that addtype already and instead of displaying the pages on my site, a dialog box popped up and gave me the option of downloading the file. Penagate: No, I'm one of those guys who gets bills in the mail and the 6 figure sales from the site help to pay them. So screwing around with ESTABLISHED rankings is what concerns me I can redirect until my the cows come home, but I'm not willing to do that YET. I have a shopping cart on another site that is PHP and uses modrewrite to avoid the gobbledegook URLS, and I'll be moving this site to that same cart program. I'm not going to start using redirects now just to make the URL extensions .php and then have to use redirects again to get the new url structure. TwistMyArm: Search Engines don't prefer .ASP. But my pages that are RANKED already are .asp and as soon as I start playing with changing the filenames OR the file extensions, rankings can go down. Is it a guarantee? Nope, but the bills that show up in my mailbox are so I'm not screwing around with it until I'm comfortable with a potential drop in sales. Smaaz: See above why a redirect is not an option at this time. The point is, all i want to happen is for php code to execute or be parsed or whatever on my existing ranked .asp pages. I'm surprised it's not an easy fix. Thanks for the replies! James...
Well - jestep's solution should work - but it depends on how your hosting is set up. If you have Cpanel available, you may be able to do it through the MIME type control panel?
Missed that! You could also try one of these: AddType x-mapp-php4 .asp Or AddType application/x-httpd-php4 .asp