htaccess redirect for two sites
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- htaccess redirect for two sites
htaccess redirect for two sites
13-04-2015 2:32 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I currently use this code in my .htaccess file to redirect one of my domains to a folder on my ccgi space as follows...
RewriteEngine on
RewriteCond %{HTTP_HOST} ^([^.]+\.)?yourdomain\.co\.uk$ [NC]
RewriteCond %{REQUEST_URI} !^/yoursite/
RewriteRule (.*) /yoursite/$1
However I now have a second domain (lets call it 'otherdomain.co.uk'). Does anyone have any idea how I can get this working while still keeping my other domain redirect intact?
Regards
Matt
Re: htaccess redirect for two sites
13-04-2015 3:01 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Bob Pullen
Plusnet Product Team
If I've been helpful then please give thanks ⤵
Re: htaccess redirect for two sites
13-04-2015 3:45 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator

Thanks Bob
Re: htaccess redirect for two sites
14-04-2015 9:03 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I've updated the .htaccess file as follows
RewriteEngine on
RewriteCond %{HTTP_HOST} ^([^.]+\.)?yourdomain\.co\.uk$ [NC]
RewriteCond %{REQUEST_URI} !^/yoursite/
RewriteRule (.*) /yoursite/$1
RewriteEngine on
RewriteCond %{HTTP_HOST} ^([^.]+\.)?otherdomain\.co\.uk$ [NC]
RewriteCond %{REQUEST_URI} !^/otherdomain/
RewriteRule (.*) /otherdomain/$1
However when visiting http://otherdomain.co.uk ; is goes to my standard PN webspace
If I go to www.otherdomain.co.uk it gives me a HTTP 403 error
My domain settings in the portal are as follows
Left Field Type Pri Right Field
otherdomain.co.uk. A 91.136.8.9
www CNAME otherdomain.co.uk.
Is this correct? If so, will it work right away after updating the DNS records?
Cheers
Re: htaccess redirect for two sites
14-04-2015 10:36 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Bob Pullen
Plusnet Product Team
If I've been helpful then please give thanks ⤵
Re: htaccess redirect for two sites
14-04-2015 11:01 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I'm not sure if this is the same area as you mentioned but it is listed under My Account > Domain Names. See attached screen shot of the domain and its settings I have done by selecting the 'Other' option under Domain Hosting Settings. (I've based them on my other domain which points to a ccgi folder and presumed the same logic would work).
Regards
Re: htaccess redirect for two sites
14-04-2015 12:08 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Bob Pullen
Plusnet Product Team
If I've been helpful then please give thanks ⤵
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- htaccess redirect for two sites