WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] adding www to url routes me to home page (2 posts)

  1. stimsonm
    Member
    Posted 2 years ago #

    When I go to http://example.com/page my page shows fine but when i try to use http://www.example.com/page it redirects me to the homepage at http://example.com/

    So as soon as i use the www. in the domain it goes to the homepage no matter what.

    it does this for all my static pages, its not that annoying only when trying to get to the page directly.

    Can anyone help me?

  2. stimsonm
    Member
    Posted 2 years ago #

    Solved, one of the core developers was really kind in helping me out, I placed this at the top of the htaccess file:

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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.