SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ReDirect problems - all help appreciated

    I am using http://www.ragepank.com/redirect-check/

    To check my Redirect fro my site: http://www.trade-th.com/

    I am told:

    2 pages returned a 200 response. This indicates potential for duplicate content problems.
    Ideally, only http://www.trade-th.com OR http://trade-th.com should return a 200 response.

    http://www.trade-th.com returns a 200 (OK) response. PR N/A
    http://trade-th.com returns a 200 (OK) response. PR N/A

    The code i am using is:

    RewriteEngine On
    RewriteBase /
    RewriteCond % ^www.trade-th.com.com [NC]
    RewriteRule ^(.*)$ http://trade-th.com/$1 [L,R=301]

    All help appreciated

  2. #2
    SitePoint Wizard bronze trophy Jeff Mott's Avatar
    Join Date
    Jul 2009
    Posts
    1,155
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by RayWilk View Post
    RewriteCond % ^www.trade-th.com.com [NC]
    The condition variable is supposed to be %{HTTP_HOST}, and you typed .com twice. And since this is a regular expression, where a period has special meaning, you should escape literal periods as \.
    "First make it work. Then make it better."

  3. #3
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello Jeff,

    Thank you for your reply, and detailed info,

    Yes I got it correct now

    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} ^www\.trade-th\.com [NC]
    RewriteRule ^(.*)$ http://trade-th.com/$1 [L,R=301]

    many Thank yous

    Quote Originally Posted by Jeff Mott View Post
    The condition variable is supposed to be %{HTTP_HOST}, and you typed .com twice. And since this is a regular expression, where a period has special meaning, you should escape literal periods as \.


Bookmarks

Posting Permissions

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