Advertisement

07.16.2008 at 06:21AM PDT, ID: 23569485 | Points: 500
[x]
Attachment Details

htaccess 301 redirect subdomain but keep the sub name before the domain name

Asked by daedalus3474 in Apache Web Server, CGI Scripting

Tags: htaccess apache linux

Hi All,
I have a domain www.domain.co.uk and a subdomain sub.domain.co.uk.
Both point to the same root directory.
I want to, via a .htaccess file, have sub.domain.co.uk redirect (permanent) to sub.domain.co.uk/subdir/newdirectory/

I have so far been able to redirect the subdomain succesfully but it loses the the subdomain name before the domain name, I don't want this to happen. ie: http://domain.co.uk/subdir/newdirectory/
what I want is: http://sub.domain.co.uk/subdir/newdirectory/

I've searched all over the place but can't find anything that doesn't drop the subdomain name.

Help appreciatedStart Free Trial
 
Loading Advertisement...
 
[+][-]07.16.2008 at 08:54AM PDT, ID: 22017178

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.16.2008 at 10:01AM PDT, ID: 22017884

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628