Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have recently had to change a URL on a website (in PHP on Apache).

The old URL is:
When a user visits the above link.
The new URL is:

I have tried variants of the following (and some others), but its just not working for me.

RewriteCond %{REQUEST_URI} ^/hidden/discounts/$ [NC]
RewriteRule ^/hidden/discounts/$ /charity_benefits.php [R=302,L,NC]

I need the redirect to redirect to www (Notice the www! Its important!).

So basically, a simple redirect from the old page to the new page. (Which are on different subdomains (OLD: content., NEW: www.) which are hosted on the same server).

share|improve this question
up vote 0 down vote accepted

OK, Figured out the issue, posting it as the answer incase someone else has this simple issue.
Basically, I had 2 subdomains content. and www.
It turns out I was editing the wrong .htaccess file!

I needed to add the rewrite rule to the .htaccess which is hosted on content.
I was trying to add it to the .htaccess hosted on www..

So obviously it didnt work.

So if your redirects are not working (and your using multiple subdomains to point to different folders)...


(why do dumb things like this always happen to me!)

share|improve this answer
You should accept this answer, too. – msanford Oct 4 '12 at 15:19
It says I have to wait 2 days.. I will... in 2 days.. – Anil Oct 4 '12 at 15:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.