Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2010
    Posts
    16
    Plugin Contributions
    0

    Default Need help for .htaccess redirect

    I made the redirection several days ago, but It seems that It doesn't work. The htaccess info as follow:

    Options +FollowSymlinks
    RewriteEngine on
    rewritecond %{http_host} ^reddoublehappiness.com [nc]
    rewriterule ^(.*)$ http://www.reddoublehappiness.com/$1 [r=301,nc]

    rewritecond %{http_host} ^www.chinesedecorationshop.com [nc]
    rewriterule ^(.*)$ http://www.reddoublehappiness.com/$1 [r=301,nc]

    It is correct?

  2. #2
    Join Date
    Oct 2006
    Location
    Alberta, Canada
    Posts
    4,571
    Plugin Contributions
    1

    Default Re: Need help for .htaccess redirect

    RewriteEngine ON

    ## Rewrite / Redirect all requests
    ## from: http://reddoublehappiness.com
    ## to: http://www.reddoublehappiness.com
    RewriteCond %{HTTP_HOST} ^reddoublehappiness.com(.*)
    RewriteRule ^(.*)$ http://www.reddoublehappiness.com/$1 [R=301,L]


    As for "www . chinesedecorationshop . com" better to do a URL redirect from within your Registrar account.

  3. #3
    Join Date
    Mar 2010
    Location
    UK
    Posts
    445
    Plugin Contributions
    0

    Default Re: Need help for .htaccess redirect

    Neither of the above will redirect requests for the non-www hostname of chinesedecorationshop.com nor for www.reddoublehappiness.com:80 or other appended port numbers.

    How to fix this, depends on whether other domain names point to this server, or not.

    If there are no other domain names that serve content, and all alternative hostnames need to redirect, this is the simplest way:
    Code:
    Options +FollowSymlinks
    
    RewriteEngine on
    
    RewriteCond %{HTTP_HOST} !^www\.reddoublehappiness\.com$
    RewriteRule (.*) http://www.reddoublehappiness.com/$1 [R=301,L]
    Remember to escape literal periods in patterns, and don't play fast and loose with the syntax.

  4. #4
    Join Date
    Apr 2010
    Posts
    16
    Plugin Contributions
    0

    Default Re: Need help for .htaccess redirect

    Yes, I want to redirect reddoublehappiness.com to www.reddoublehappiness.com and I also want to redirect www.chinesedecorationshop.com to www.reddoublehappiness.com, how to do this?

  5. #5
    Join Date
    Oct 2006
    Location
    Alberta, Canada
    Posts
    4,571
    Plugin Contributions
    1

    Default Re: Need help for .htaccess redirect

    You have been given two examples of redirecting reddoublehappiness.com.

    For chinesedecorationshop.com, it is best to redirect it from within your Registrar account.

  6. #6
    Join Date
    Mar 2010
    Location
    UK
    Posts
    445
    Plugin Contributions
    0

    Default Re: Need help for .htaccess redirect

    Do you also want to redirect chinesedecorationshop.com too?

 

 

Similar Threads

  1. v154 Using htaccess to redirect legacy links. Need help!
    By Feznizzle in forum General Questions
    Replies: 19
    Last Post: 5 Jan 2016, 03:11 AM
  2. .htaccess redirect help for a coming soon URL
    By limelites in forum General Questions
    Replies: 4
    Last Post: 17 Jul 2011, 02:32 AM
  3. I need help with .htaccess redirect!
    By htmt in forum Basic Configuration
    Replies: 0
    Last Post: 26 Apr 2011, 02:53 PM
  4. Replies: 3
    Last Post: 11 Apr 2010, 07:57 AM
  5. Need to redirect, can't find .htaccess - help?
    By Unicorn in forum General Questions
    Replies: 10
    Last Post: 20 Feb 2010, 05:28 PM

Posting Permissions

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