: Using .htaccess to redirect .asp to .php? Ahoy all! I've been racking my brain with this one. I basically just converted all of my pages from ASP code to PHP code. Kept the same filenames.
Ahoy all! I've been racking my brain with this one.
I basically just converted all of my pages from ASP code to PHP code. Kept the same filenames.
So, here is the htaccess code I have so far, but it keeps redirecting to my ROOT.... ie /home/accountname/publc_html...
What am I doing wrong?
RewriteRule (.*).asp .php [R=301]
More posts by @Bryan171
3 Comments
Sorted by latest first Latest Oldest Best
try adding a slash before the target url () like:
RewriteEngine on
RewriteRule ^(.*).asp$ /.php [R=301,NC]
If you are running PHP on IIS and know that you don't have any .asp pages left over you can add a handler for IIS to interpret .asp pages as PHP. This is just a neat trick that masks the fact that you are actually running PHP.
@anagio 's rewrite rule will work. Make sure its a permanent redirect by adding the appropriate header.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.