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.
Joined
Jul 13, 2004
Posts
5,851
Reaction score
385
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 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.

Rule #1: Be Respectful

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

Premium Members

New Threads

Domain Forum Friends

Lastest Listings

Our Mods' Businesses

*the exceptional businesses of our esteemed moderators
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Siusaidh AcornBot:
    Siusaidh has left the room.
      Siusaidh AcornBot: Siusaidh has left the room.
      Top Bottom