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

  1. ghaus
    Posted 7 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
    Posted 7 years ago #

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

  3. fool4Christ
    Posted 7 years ago #

    Well, if you wanted to get rid of WWW, you could try Automattic's no-WWW plugin:

    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
    Posted 7 years ago #

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

  5. fool4Christ
    Posted 7 years ago #

    Did the method I suggested work, ghaus?

  6. DezineJunkie
    Posted 7 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
    Posted 7 years ago #

    i found this
    i think this plugin will do it-

  8. ChuckMcKay
    Posted 7 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 7 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