[thelist] rewrite/redirect php3 to php?

Joe Crawford jcrawford at avencom.com
Mon Aug 27 15:05:27 CDT 2001


muinar wrote:
> It's hard to find something on this, although it seems to
> me that it's a quite common problem:
> 
> I switched to a new server which has php4 installed instead
> of the old php3. I renamed all the pages and links to .php
> (The old version needed the filename ending php3)
> 
> Now when a visitor uses an old bookmark which ends with .php3,
> he will get a 404 error. Is there a way to rewrite or redirect
> users to the according php page? If this can be done with
> mod_rewrite in Apache, I'd appreciate any hints.
> 
> Thank you!

How about this - put this in an .htaccess file at your root level
directory.

#HOW TO MAKE .php files masquerade as .php3
RewriteEngine On
RewriteRule  ^(.+).php3 $1.php

This will also propagate to child directories.

	- Joe <http://artlung.com/>
-- 
...................  Joe Crawford \\ Web Design & Development
.....  mailto:jcrawford at avencom.com \\ http://www.avencom.com
.... San Diego \\ CA \\ USA \\ AVENCOM: Set Your Sites Higher




More information about the thelist mailing list