Web Analytics Made Easy -
StatCounter 301 redirect of index.html also redirects subdomain.... - CodingForum

Announcement

Collapse
No announcement yet.

301 redirect of index.html also redirects subdomain....

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 301 redirect of index.html also redirects subdomain....

    How can I successfully do:


    redirect 301 /index.html www.mysite.com/page.extension


    without


    subdomain.mysite.com being redirected as well


    Any help would be appreciated.

  • #2
    I'm assuming you have the code in an .htaccess file. Either...

    Have the sub-domains DocumentRoot different to the main one, so that it never hit the file (unlikely to be useful as you are obviously using the same code base).
    Move the code into the VirtualHost for the main domain (probably haven't got access to it, especially if you're on shared hosting).
    Use mod_rewrite to redirect instead.

    Code:
    RewriteCond %{HTTP_HOST} ^www.mysite.com
    RewriteRule index.html /page.extension [R=301,L]

    Comment

    Working...
    X
    😀
    🥰
    🤢
    😎
    😡
    👍
    👎