Jump to content


Photo
- - - - -

forcing a particular domain


  • Please log in to reply
4 replies to this topic

#1 mikef

mikef

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,551 posts

Posted 08 May 2007 - 10:30 PM

I seem to have painted myself into a corner.

I have a website with two domain names pointing to it (.com and .co.uk). I want all links to be to the .com domain for SEO purposes.
I've done this before and used htaccess rewrite rules to do it:
RewriteCond %{HTTP_HOST} !^www.fred.com$ [NC]
RewriteRule ^(.*)$ http://www.fred.com/$1 [L,R=301]
However this also affects subdirectories, and in this particular case I have a subdirectory that holds a forum, and this forum has been accessed via the .co.uk domain (http://www.fred.co.uk/forum/).
I don't know if that can be addressed by htaccess rules (which also have to cater for friendly URLs)

It occured to me one way round this might be to make the URL generation in index.php always generate the .com form of the urls, in which case only the initial page would exist in both .com and .co.uk forms, and all internal links within the site would always be .com.

Is this:
1) sensible
2) easy.

(fred.co.uk/forum really doesn't like being called as fred.com/forum and won't actually log you in. It accepts user id and password, validates them, and then dumps you back to the login page. It uses phpbb.)

Any suggestions welcome

#2 Dean

Dean

    Loves Etomite Forums!

  • Admin
  • 4,786 posts

Posted 09 May 2007 - 08:24 AM

Why don't you copy the etomite manager .htaccess file into your forums folder, switching the rewrite rules off for that folder?

#3 mikef

mikef

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,551 posts

Posted 09 May 2007 - 09:29 AM

I'll have to set up another pair of domains to play around with, but I thought that it would first read the rules in the home page of the site anyway, and so change the domain at that level before going on to the subdirectory?

There is already a .htaccess file in the forum directory (without any rewrite rules, its for other things); I thought if there was one then rules from the .htaccess in the parent directory are not applied at the point of entering the directory?

#4 TedD

TedD

    Etomite Forum Newbie

  • Member
  • 34 posts

Posted 09 May 2007 - 08:48 PM

Read the topics about Explorer 7. You have a problem with some of your websites.....
Topic IE 7 and Mollio

Attached File  problems.jpg   127.98K   10 downloads

#5 mikef

mikef

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,551 posts

Posted 09 May 2007 - 09:34 PM

Thanks Ted. I'll try to look at it later. When I checked with IE7 a while back they looked OK, but will check again.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users