htaccess redirect from wordpress page to a php page

Posted by JustAnil on Server Fault See other posts from Server Fault or by JustAnil
Published on 2012-10-04T14:31:08Z Indexed on 2012/10/04 15:41 UTC
Read the original article Hit count: 250

Filed under:
|
|

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

© Server Fault or respective owner

Related posts about php

Related posts about .htaccess