Jump to content

Conditional Redirecting


tendrousbeastie

Recommended Posts

Hi All,

 

I have a question to which I'm sure the answer is no, but I will ask anyway... I'll explain my question and then explain why I need it, as someone may be able to suggest an alternative...

 

 

What I need is someway within Apache to redirect all request for page xxx.htm to xxx.php, where xxx could be any filename, but only when xxx.htm doesn't exist. If xxx.htm does exist then it should be served up as normal, and only in its absence should its PHP counterpart be served.

 

 

The reason I need this is because I administer a newletter site, which so far has about 700 editions, each of which is in the filename format of newxxx.htm (where xxx is the edition number). There are various system built on top of this filename system, such as search engines and keywords tagging, that all expect the files for each edition to follow this naming sequence.

 

Arbitrarily changing the new editions to .php would mean that these subsystems could no longer find them, and I am hoping to avoid having to rewrite these subsystems (as I didn't write them in the first place, and the guy who did was not a tidy or well commented coder).

 

 

Thanks for any suggestions.

 

Link to comment
https://forums.phpfreaks.com/topic/127143-conditional-redirecting/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.