1 gregraven Feb 18, 2007 21:57
3 gregraven Feb 19, 2007 00:12
Thanks. I'll check mod_rewrite, but I usually don't understand the jargon very well, so I was hoping someone had a scrap of existing code.
As for asking Earthlink to set something up differently, apparently you've never dealt with Earthlink: They do what they do, period.
4 gregraven Feb 19, 2007 00:56
Well, I just tried both Addhandler and RewriteRule in my htaccess file, and neither seemed to work. I'm still open to suggestions.
5 blueyed Feb 19, 2007 01:06
It would have helped if you had posted your RewriteRule set.
E.g. have you used RewriteEngine On ?
6 gregraven Feb 19, 2007 01:19
Here's the first one I tried:
RewriteEngine on
RewriteBase /webdocs/cms/
# parse out basename, but remember the fact
RewriteRule ^(.*)\.php$ $1 [C,E=WasHTML:yes]
# rewrite to document.php5 if exists
# RewriteCond %{REQUEST_FILENAME}.php5 -f
RewriteRule ^(.*)$ $1.php5 [S=1]
# else reverse the previous basename cutout
# RewriteCond %{ENV:WasHTML} ^yes$
# RewriteRule ^(.*)$ $1.php
7 gregraven Feb 19, 2007 01:21
I also tried this:
AddType application/x-httpd.php5 .php
addhandler application/x-httpd.php5 .php
8 gregraven Feb 19, 2007 01:30
These don't work, either:
AddType application/x-httpd.php .php
addhandler application/x-httpd.php .php
AddType application/x-httpd.php .php5
addhandler application/x-httpd.php .php5
You should be able to do this with RewriteCond (check for the .php ending) and the rewrite the URL with RewriteRule (internally, so no [R] or absolute URL).
Just google for mod_rewrite and you should find it.
btw: you could also use PHP4 (normal .php ending?) for it. Or ask your host to set it up the other way round.