WordPress.org

Ready to get started?Download WordPress

Forums

How to redirect from http://site.com to http://www.site.com ? (9 posts)

  1. ghaus
    Member
    Posted 6 years ago #

    When user types http://myblog.com, i want it to automatically redirect to http://www.myblog.com.

    Now which code should i type in the which file, so that this redirection takes place.

    Please I need to do this. Thanks in Advance !

  2. Doodlebee
    Member
    Posted 6 years ago #

    didn't I already respond to this question earlier? I'm pretty sure I did...

  3. fool4Christ
    Member
    Posted 6 years ago #

    Well, if you wanted to get rid of WWW, you could try Automattic's no-WWW plugin:
    http://wordpress.org/extend/plugins/no-www/

    Otherwise, if you still want to enforce WWW (kudos on wanting to enforce a canonical domain, by the way), you could add this to your .htaccess file, assuming you are on Apache:

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

    Change "domain" and "com" to your appropriate domain. Don't remove the "\" from the first line. This method is from 456 Berea Street.

  4. ghaus
    Member
    Posted 6 years ago #

    Actually doodlebee, you responded but, this is a new different question. Read the question carefully please.

  5. fool4Christ
    Member
    Posted 6 years ago #

    Did the method I suggested work, ghaus?

  6. DezineJunkie
    Member
    Posted 6 years ago #

    i think im asking the same Q. i have a site http://www.mysite.com
    i want to use WP within that site, but when the user types in
    http://www.mysite.com i want WP to open. How do i accomplish that without having to type http://www.mysite.com/blog

  7. DezineJunkie
    Member
    Posted 6 years ago #

    i found this
    http://urbangiraffe.com/plugins/redirection/
    i think this plugin will do it-

  8. ChuckMcKay
    Member
    Posted 6 years ago #

    I believe this is a function you can access from inside WordPress after you've set it up.

    From the dashboard go to Options, General, and the forth blank down is the Blog Address URL blank. "If you want your blog homepage to be different than the directory you installed WordPress in, enter that address here."

  9. Rev. Voodoo
    Volunteer Moderator
    Posted 6 years ago #

    I have been trying forever to fix an issue with http://www.RVoodoo.com

    I'm not sure if it was how I set it up or whatever, but I couldn't get the page to load using both RVoodoo.com and http://www.RVoodoo.com

    If I changed things up in the options panel, I could load it as it was set, but not the other way. That would say that the site was uploaded incorrectly.

    But the .htaccess lines posted above finally fixed my problem, and it can be loaded either way. Thank you much!

Topic Closed

This topic has been closed to new replies.

About this Topic