.htaccess

Soldato
Joined
16 Oct 2007
Posts
7,481
Location
UK
Hi all,

A quick question -

I want any requests for domain.co.uk to get redirected to another site, APART from domain.co.uk/specificfolder

.htaccess the way forward?

Thanks very much
 
I would say so, although coding for .htaccess goes way over my head so I've pretty much stolen every piece of .htaccess code I've ever used.

Google for the code you want.
 
Thanks chief - I have googled, and it's somewhat daunting. Hoping someone might be able to assist in pointing me in the right direction
 
My host says to do one of these :

Redirect from olddomain.com to www.newdomain.com:

RewriteEngine On

RewriteCond %{HTTP_HOST} !newdomain.com$ [NC]

RewriteRule ^(.*)$ http://www.newdomain.com/$1 [L,R=301]

This is useful when you use www.newdomain.com as your new domain name. If not - use the code below.

Redirect from olddomain.com to newdomain.com:

RewriteEngine On

RewriteBase /

RewriteCond %{HTTP_HOST} !newdomain.com$ [NC]

RewriteRule ^(.*)$ http://newdomain.com/$1 [L,R=301]
 
Back
Top Bottom