Jump to content

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.
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.