corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » Geek Day » .htaccess folk - need help


New Topic

New Poll
  Subscribe | Add to Favourites

You are not logged in and may not post or reply to messages. Please log in or create a new account or mail us about fixing an existing one - register@corsasport.co.uk

There are also many more features available when you are logged in such as private messages, buddy list, location services, post search and more.


Author .htaccess folk - need help
Dom
Member

Registered: 13th Sep 03
User status: Offline
21st Jun 06 at 00:51   View User's Profile U2U Member Reply With Quote

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
21st Jun 06 at 01:05   View User's Profile U2U Member Reply With Quote

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
21st Jun 06 at 01:19   View User's Profile U2U Member Reply With Quote

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
21st Jun 06 at 01:23   View User's Profile U2U Member Reply With Quote

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
21st Jun 06 at 01:47   View User's Profile U2U Member Reply With Quote

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
21st Jun 06 at 08:05   View User's Profile U2U Member Reply With Quote

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
21st Jun 06 at 12:33   View User's Profile U2U Member Reply With Quote

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
21st Jun 06 at 23:37   View User's Profile U2U Member Reply With Quote

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

 
New Topic

New Poll

  Related Threads Author Forum Replies Views Last Post
htaccess Melville Geek Day 3 515
14th Dec 05 at 22:17
by Melville
 
Web people Steve Geek Day 8 545
1st Mar 06 at 13:52
by Tim
 
Php.ini Jodi_the_g Geek Day 7 939
17th Apr 06 at 16:14
by Ian
 
.htaccess RewriteRules MikeLamb Geek Day 1 684
28th Apr 06 at 23:06
by waynep
 
Grrrr... Having a bad day so I need some .htaccess help.. ed Geek Day 4 550
8th Jun 06 at 00:06
by Ian
 

Corsa Sport » Message Board » Off Day » Geek Day » .htaccess folk - need help 29 database queries in 0.0142951 seconds