Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
Thread Tools Display Modes
Share |
  #1  
Old 06-11-2007, 01:20 PM
onlineart onlineart is offline
Junior Member
 
Join Date: 05-18-07
Location: UK
Posts: 13
iTrader: 0 / 0%
.htaccess multiple sites?

Hi, Could anyone explaine how to permanent redirect multiple sites please?

I have one main domain onlineartdemos.co.uk that I want to keep, and two domains wildlifeart-online.co.uk and .com that I would like to redirect to onlineartdemos.co.uk they are all kept with the same hosting company and at the moment the two wildlifeart-online ones are just domain name forwarded.

Appreciate any help for my newbie mind please
 
Reply With Quote

Advertisement

Advertisement

  #2  
Old 06-11-2007, 02:56 PM
kos's Avatar
kos kos is offline
Coding Tiger
 
Join Date: 04-13-07
Location: .ro
Posts: 4,029
iTrader: 3 / 100%
maybe this can help:
 
Reply With Quote
  #3  
Old 06-11-2007, 10:27 PM
alainkun alainkun is offline
Contributing Member
 
Join Date: 05-06-07
Posts: 84
iTrader: 0 / 0%
You can see how to do it with .htaccess here:
http://www.webweaver.nu/html-tips/web-redirection.shtml
 
Reply With Quote
  #4  
Old 06-12-2007, 12:28 AM
onlineart onlineart is offline
Junior Member
 
Join Date: 05-18-07
Location: UK
Posts: 13
iTrader: 0 / 0%
Thanks both,

So basically to redirect multiple sites I can just use the script for each site (changing the site address' for each) and put them in the same .htaccess file? is that correct?

Thanks again
 
Reply With Quote
  #5  
Old 06-12-2007, 12:36 AM
kos's Avatar
kos kos is offline
Coding Tiger
 
Join Date: 04-13-07
Location: .ro
Posts: 4,029
iTrader: 3 / 100%
I can't help you with this one, mate
I'm not the PHP guru here.

Relax, enjoy the forums...you'll get your answers soon enough
 
Reply With Quote
  #6  
Old 06-12-2007, 12:53 AM
alainkun alainkun is offline
Contributing Member
 
Join Date: 05-06-07
Posts: 84
iTrader: 0 / 0%
I think you have 3 folders for 3 domains. So put this code in each of this 3 folders.
 
Reply With Quote
  #7  
Old 06-12-2007, 01:42 AM
onlineart onlineart is offline
Junior Member
 
Join Date: 05-18-07
Location: UK
Posts: 13
iTrader: 0 / 0%
I think at the moment my hosting company (1&1) just point my spare domains to the folder which contains the index file for the main site, so they all just point to the same thing.
 
Reply With Quote
  #8  
Old 06-12-2007, 05:30 AM
ScriptMan's Avatar
ScriptMan ScriptMan is offline
Super Moderator
 
Join Date: 02-10-07
Location: Central Kentucky
Posts: 14,038
iTrader: 4 / 100%
Now we have identified the real problem;

Quote:
my hosting company (1&1)
If you had a better host this would be no problem. Setting redirects using cPanel is very simple.

Best wishes.
 
Reply With Quote
  #9  
Old 06-12-2007, 08:31 AM
onlineart onlineart is offline
Junior Member
 
Join Date: 05-18-07
Location: UK
Posts: 13
iTrader: 0 / 0%
I just checked and it does appear that the host is just pointing all three domain names to the same index file, so I searched the web and came up with the stuff below, is it correct? so do I just have to put that in the .htaccess file and put it next the the index file? and do it twice (once for each domain I want to redirect) in the same .htaccess file with a blank line in between?


If both olddomain and newdomain point to the same server filespace, then you will need to tell this rewrite rule not to redirect newdomain to itself, which it will do unless told otherwise.

Options +FollowSymLinks
RewriteEngine on
#
RewriteCond %{HTTP_HOST} !^www\.newdomain\.com
RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]

The added RewriteCond prevent the rule from being applied unless the requested domain is NOT "www.newdomain.com"
 
Reply With Quote
  #10  
Old 06-12-2007, 02:08 PM
ScriptMan's Avatar
ScriptMan ScriptMan is offline
Super Moderator
 
Join Date: 02-10-07
Location: Central Kentucky
Posts: 14,038
iTrader: 4 / 100%
You are going to have to ask this question from the support gurus at 1+1.

They utilize a non-standard server config and some home grown control panel. Any advice you get elsewhere means nothing.

With any luck you should hear back from them in a couple of weeks.
 
Reply With Quote
  #11  
Old 06-12-2007, 10:59 PM
alainkun alainkun is offline
Contributing Member
 
Join Date: 05-06-07
Posts: 84
iTrader: 0 / 0%
I dont know about 1+1. So maybe problem is there.
I undertood that you dont want redirect nothing in onlineartdemos.co.uk So code should be something like this:

Quote:
Options +FollowSymLinks
RewriteEngine on
#
RewriteCond %{HTTP_HOST} !^www\.newdomain\.com
RewriteRule http://wildlifeart-online.co.uk/(.*) http://www.newdomain.com/$1 [R=301,L]
RewriteRule http://wildlifeart-online.com/(.*) http://www.newdomain.com/$1 [R=301,L]
 
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Launching Multiple Sites theChronic Marketing Forum 2 06-16-2006 07:41 AM
Multiple sites on one host? pabawn Google Forum 7 05-17-2004 05:40 PM


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 09:29 AM.
Powered by vBulletin
Copyright 2000-2014 Jelsoft Enterprises Limited.
Copyright © 2003 - 2018 VIX-WomensForum LLC