WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Site without prefix(www.) keep redirect to the signup page. (6 posts)

  1. eric_liang
    Member
    Posted 2 years ago #

    hi guys,
    I got a huge problem when I type: domain.com
    it keep redirects me to sign up page.
    I tried using :
    define( 'NOBLOGREDIRECT', 'http://yourdomain.com/' );

    but it makes my 404 page doesn't work.

    Any thoughts?

  2. You could try an .htaccess redirect though define( 'NOBLOGREDIRECT', 'http://yourdomain.com/' ); says 'If there's no blog, go to http://yourdomain.com/' and it SOUNDS like you mean 'If there's no blog, go to http://www.yourdomain.com/'

    So you shoulda used define( 'NOBLOGREDIRECT', 'http://www.yourdomain.com/' );

    htaccess will look something like :

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^your_domain.com$
    RewriteRule ^(.*)$ http://www.your_domain.com/$1 [R=301]

    Put it on the top of your .htaccess, well above the WP section.

  3. eric_liang
    Member
    Posted 2 years ago #

    I tried, it's not working :(
    showed up this:

    Moved Permanently

    The document has moved here.

    Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

  4. eric_liang
    Member
    Posted 2 years ago #

    oh I tried the define( 'NOBLOGREDIRECT', 'http://www.yourdomain.com/' );

    when I did that, it works but my 404 page doesn't work. so I removed that back. I want both to work.

  5. when I did that, it works but my 404 page doesn't work.

    What theme?

  6. eric_liang
    Member
    Posted 2 years ago #

    got it! got it! thanks ipstenu! I cleared the cache and it works with the code that you gave(htaccess)..

Topic Closed

This topic has been closed to new replies.

About this Topic