CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   Apache configuration (http://www.codingforums.com/forumdisplay.php?f=69)
-   -   Having issues redirecting subdirectory to domain (http://www.codingforums.com/showthread.php?t=270735)

nicky 08-17-2012 03:58 PM

Having issues redirecting subdirectory to domain
 
My hosting plan is hosting two domains.

1) Main domain - abc.com
2) Blog domain - xyz.com

The 2nd domain is contained within a subdirectory of the main domain, so abc.com/blog/ is also xyz.com

I have been trying to edit my .htaccess file to redirect abc.com/blog to xyz.com, but every time I get it work, the stylesheet gets stripped from the xyz.com.

Can someone please point me in the right direction? The .htaccess file resides in the root directory. Do I need a separate one in the 'blog' directory?

Lamped 08-18-2012 12:45 AM

Try:

Code:

RewriteRule ^blog(.*) http://xyz.com$1 [R=301,L]
You'll need the R=301 to force a full browser reload to the new URL, or edit xyz.com to use relative URLs for the stylesheet (and everything else).

nicky 08-20-2012 01:31 PM

Thank you, that worked!


All times are GMT +1. The time now is 08:45 PM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.