Membership is FREE – with unlimited access to all features, tools, and discussions. Premium accounts get benefits like banner ads and newsletter exposure. ✅ Signature links are now free for all. 🚫 No AI-generated (LLM) posts allowed. Share your own thoughts and experience — accounts may be terminated for violations.

url redirecting using htaccess

Status
Not open for further replies.

PaullasPaullas is verified member.

Acorn Moderator
Nominet Member
Nominet Registrar
Hosting Provider
Domain Marketplace
Parking Service
Joined
Jul 13, 2004
Posts
5,862
Reaction score
397
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]
 
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.
General chit-chat
Help Users
  • No one is chatting at the moment.
      Helmuts @ HelmutsHelmuts is verified member.: Good morning all
      Top Bottom