Forum Moderators: coopster
I want say mysite.com/about.html to point to mysite.com/about.php IF that page "about.html" does not exist on the server.
To complicate things. I already have some rules in .htacces that will redirect things like mysite.com/article/35.html to mysite.com/article.php?=35
I want to redirect old html pages so that if someone follows an old link, it transparently brings up the .php page, without messing up my existing set of rules.
How do I do this?
Thanks
or maybe:
Redirect temporary /relative_source_url [full_destination_url...]
dc
why not just change your config so you can have the html pages parsed for php, then there is no need to change pagenames at all.
for apache
AddType application/x-httpd-php .php .html
_______
What I want to make sure is that IF a .html page exists then it should use the original .html page, and IF a .html page doesn't exist THEN go to .php (same filename)
Will that be done with the above?
Or can I do this with a .htaccess?
See this link:
[httpd.apache.org...]
Has all the info you need.
I guess the logic would be something like this:
try to match uri
if fail then try to map to similarly name php file (or use it as a string to the php file for processing correct data).
Something like:
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^([A-Za-z]).html$ $1.php [L]
Hope that helps.