Jump to content

Need Help redirecting changed php to html files


dbrimlow

Recommended Posts

I changed @ 10 of my php pages back to html.

I revised the pages with pure css layout and converted the navbar includes insert to an external jscript navbar write.

What I want to do is have anyone who bookmarked the php versions of the pages auto-redirected to the new html versions.

I am temporarily using a redirect link within the php pages themselves.

Thanks,

Dave
  • 2 weeks later...
[!--quoteo(post=358958:date=Mar 27 2006, 01:51 PM:name=dbrimlow)--][div class=\'quotetop\']QUOTE(dbrimlow @ Mar 27 2006, 01:51 PM) [snapback]358958[/snapback][/div][div class=\'quotemain\'][!--quotec--]
I changed @ 10 of my php pages back to html.

I revised the pages with pure css layout and converted the navbar includes insert to an external jscript navbar write.

What I want to do is have anyone who bookmarked the php versions of the pages auto-redirected to the new html versions.

I am temporarily using a redirect link within the php pages themselves.

Thanks,

Dave
[/quote]
Place the following in the .htaccess file (if mod_rewrite is available):

[code]RewriteEngine on
RewriteRule ^/([a-z][A-Z][0-9]-/+).php$ $1.html [R] [/code]
That should redirect all .php requests to the respective .html equivalent (page.php should become page.html, index.php should become index.html, guestbook.php should become guestbook.html, and so forth).
[!--quoteo(post=362849:date=Apr 8 2006, 03:14 PM:name=Vorotaev)--][div class=\'quotetop\']QUOTE(Vorotaev @ Apr 8 2006, 03:14 PM) [snapback]362849[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Place the following in the .htaccess file (if mod_rewrite is available):

[code]RewriteEngine on
RewriteRule ^/([a-z][A-Z][0-9]-/+).php$ $1.html [R] [/code]
That should redirect all .php requests to the respective .html equivalent (page.php should become page.html, index.php should become index.html, guestbook.php should become guestbook.html, and so forth).
[/quote]

Is this a "blanket" conversion of all PHP? I have over 800 php pages and only want to convert specific files.
[!--quoteo(post=362866:date=Apr 8 2006, 05:59 PM:name=dbrimlow)--][div class=\'quotetop\']QUOTE(dbrimlow @ Apr 8 2006, 05:59 PM) [snapback]362866[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Is this a "blanket" conversion of all PHP? I have over 800 php pages and only want to convert specific files.
[/quote]
Yes, that would convert URLs for all PHP files. If you wanted to select only a handful of files, it would be better to use:

[code]redirectpermanent /oldpage.php http://www.somesite.com/newpage.html [R][/code]
Bearing in mind that the former link [u]should[/u] be a path.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.