|
Posted by Philip Ronan on 10/14/05 16:50
"IWT" wrote:
> Ive heard about some sort of script or program that converts a web
> address with a php extension to that with a html. E.g. say if you had
> www.abc.com/123.php the user would be able to access this via
> www.abc.com/123.html.
> We're creating a new site in php and dont want to effect our search
> engine rankings by getting rid of all our existing html pages.
Are you on an Apache server? If so, try putting this in your .htaccess file:
RewriteEngine on
RewriteRule ^(.*)\.html$ $1 [C,E=dothtml:true]
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php [S=1]
RewriteCond %{ENV:dothtml} ^true$
RewriteRule ^(.*)$ $1.html
If your server receives a request for "/path/to/foo.html", it will first
check to see if a file "/path/to/foo.php" exists. If so, it serves up the
PHP file, otherwise the HTML file gets sent out.
If you're not on an Apache server, then you might be stuck. Ask your hosting
company what your options are.
--
phil [dot] ronan @ virgin [dot] net
http://vzone.virgin.net/phil.ronan/
[Back to original message]
|