Membership is FREE, giving all registered users unlimited access to every Acorn Domains feature, resource, and tool! Optional membership upgrades unlock exclusive benefits like profile signatures with links, banner placements, appearances in the weekly newsletter, and much more - customized to your membership level!

url redirecting using htaccess

Status
Not open for further replies.

Paullas

Staff member
Joined
Jul 13, 2004
Posts
5,802
Reaction score
350
i am looking for a way to redirect urls when a user visits the page using .htaccess

for example

domain1.co.uk
domain2.co.uk
domain3.co.uk

are all parked on domain.co.uk

when a user goes to domain1.co.uk i want to divert them to domain.co.uk/domain1

i used to have this but can not find it so any help much appreciated.
 
sussed it

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?domain1.co.uk [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^(.*) http://www.domain.co.uk/domain1/$1 [L,R=301]
 
sussed it

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?domain1.co.uk [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^(.*) http://www.domain.co.uk/domain1/$1 [L,R=301]

Does that rule now work for all domains you forward or just domain1.co.uk?
 
just domains1
 
just thought i would open an old thread rather create a new one.

Is it possible to create the above using wildcard for a domain/url.

so instead of using the following per domain:

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?domain1.co.uk [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^(.*) http://www.domain.co.uk/domain1/$1 [L,R=301]

have it so it is seens for example tfts.co.uk it will divert to /tfts/
or domain1.co.uk goes to /domain1/
 
Status
Not open for further replies.

The Rule #1

Do not insult any other member. Be polite and do business. Thank you!

Members online

Premium Members

New Threads

Our Mods' Businesses

*the exceptional businesses of our esteemed moderators
General chit-chat
Help Users
  • No one is chatting at the moment.
      There are no messages in the current room.
      Top Bottom