Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.