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

The old URL is: http://content.mywebsite.org.uk/hidden/discounts/
When a user visits the above link.
The new URL is: http://www.mywebsite.org.uk/charity_benefits.php

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 mywebsite.org.uk. (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).


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!)

  • It says I have to wait 2 days.. I will... in 2 days.. – Anil Oct 4 '12 at 15:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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