Results 1 to 2 of 2
  1. #1

    Primary and Secondary Domains

    My website has a primary domain (P) and secondary domain (S), both of which can be used to access all the subpages on the site.

    While this is not really a problem, formmail doesn't work from the S domain, as it errors that the referring URL is not valid (as I would expect).

    All the links within my site only contain the file name / path - not the whole URL. If I were to put the whole URL into the path, this would ensure that people navigating within the site moved to the P domain on the first click.

    However, what is the overhead on the webserver having to translate each href as a full URL as opposed to just a file reference? And, is this the best thing to do? (Am speaking to hosting company to see if they can change the setup of the S domain such that it refers the users browser straight to the P domain, rather than point to the web page area on the server.)


  2. #2
    Join Date
    Apr 2003
    London, UK
    Well this would be because the formmail script automatically uses the accounts main domain in it's configuration. You could either look at another mail script, a PHP based option would probally be better anyway, there's loads of different mail scripts around.

    Other than that you could just use .htaccess to direct any requests for the second domain onto the same page on the main one, using something like:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^(www\.)?second_domain\.com [NC] 
    RewriteRule ^(.*)$$1 [R=301,L]
    in a .htaccess file in your sites main directory

    Then anybody going to would be redirected to

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts