Jump to content


Photo

Need Help redirecting changed php to html files


  • Please log in to reply
3 replies to this topic

#1 dbrimlow

dbrimlow
  • Members
  • PipPipPip
  • Advanced Member
  • 712 posts

Posted 27 March 2006 - 05:21 PM

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
Dave

I am always amazed by no matter how much I know, I know I don't know as much as I thought I knew.  - D. Brimlow.

#2 Vorotaev

Vorotaev
  • Members
  • PipPip
  • Member
  • 27 posts
  • LocationCanada

Posted 08 April 2006 - 08:14 PM

[!--quoteo(post=358958:date=Mar 27 2006, 01:51 PM:name=dbrimlow)--][div class=\'quotetop\']QUOTE(dbrimlow @ Mar 27 2006, 01:51 PM) View Post[/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):

RewriteEngine on
RewriteRule ^/([a-z][A-Z][0-9]-/+).php$ $1.html [R]
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).


#3 dbrimlow

dbrimlow
  • Members
  • PipPipPip
  • Advanced Member
  • 712 posts

Posted 08 April 2006 - 09:29 PM

[!--quoteo(post=362849:date=Apr 8 2006, 03:14 PM:name=Vorotaev)--][div class=\'quotetop\']QUOTE(Vorotaev @ Apr 8 2006, 03:14 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Place the following in the .htaccess file (if mod_rewrite is available):

RewriteEngine on
RewriteRule ^/([a-z][A-Z][0-9]-/+).php$ $1.html [R]
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.
Dave

I am always amazed by no matter how much I know, I know I don't know as much as I thought I knew.  - D. Brimlow.

#4 Vorotaev

Vorotaev
  • Members
  • PipPip
  • Member
  • 27 posts
  • LocationCanada

Posted 08 April 2006 - 10:57 PM

[!--quoteo(post=362866:date=Apr 8 2006, 05:59 PM:name=dbrimlow)--][div class=\'quotetop\']QUOTE(dbrimlow @ Apr 8 2006, 05:59 PM) View Post[/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:

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users