Dom
Member
Registered: 13th Sep 03
User status: Offline
|
trying to redirect a second domain to a folder on my primary domain ie:
domain2.co.uk (with and without www.) -> domain1.co.uk/bob/ (again, with/without www.)
yet my server isnt having any of it plus my knowledge on .htaccess isn't too hot
cheers all
[Edited on 21-06-2006 by Dom]
|
Dom
Member
Registered: 13th Sep 03
User status: Offline
|
Current code is -
code:
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} (www\.)?domain2.co.uk
RewriteRule ^(.*)$ /domain2/ [R=301,L]
which seems to work if using http://domain2.co.uk, but doesnt if using http://www.domain2.co.uk Also it doesn't mask up its current location, the URL (address) bar shows the redirected URL eg: http://www.domain1.co.uk/domain2 etc
|
Dan B
Member
Registered: 25th Feb 01
User status: Offline
|
Does it have to be done with .htaccess?
A simple single page on the domain you want to redirect FROM, with a meta-refresh tag, will surely do exactly the same?
http://en.wikipedia.org/wiki/META_refresh
|
Dom
Member
Registered: 13th Sep 03
User status: Offline
|
aye, thought about using meta refreshes or PHP refresh/redirect (what im currently doing), but it would be nice if it was .htaccess to make it completly seamless (as its still showing the redirected URL in the address bar)
cheers anyways
|
John
Member
Registered: 30th Jun 03
User status: Offline
|
Redirect /olddirectory/oldfile.html http://yoursite.com/newdirectory/newfile.html ?
Even easier and better suited to your situation seems to be
Redirect 301 / http://www.example.com/
I may be missing soemthing here because I only googled it.
Both of them are in htaccess btw so redirects as soon as it looks there without looading anything else.
[Edited on 21-06-2006 by John]
|
MikeLamb
Member
Registered: 23rd Sep 03
Location: Crowthorne Drives: Veccy SRI
User status: Offline
|
Either get your host to do it for you properly, or set a subdomain for www.new domain with the folder as its root.
|
Dom
Member
Registered: 13th Sep 03
User status: Offline
|
ive done it before, but cant remember how
currently, the way the DNS and host has it, domain2.co.uk already points to the root of domain1.co.uk (it doesnt give any errors etc), so i need .htaccess (or rather like to have) to redirect it to a folder on domain1.co.uk public/html etc
Mike - host leaves it to use as for the subdomain, nice idea would work but would only work if the client used www.domain2.co.uk etc - plus i think www. subdomains are banned on my CPanel.
cheers anyways guys
|
Dom
Member
Registered: 13th Sep 03
User status: Offline
|
still having problems with this as google is being a pain in the backside It works fine, just that if i use the URL www.domain2.co.uk it doesnt redirect it to the public/html/(domain2folder) only if using the URL domain2.co.uk
Any clues?
cheers all
|