WordPress.org

Ready to get started?Download WordPress

Forums

.htaccess - redirect (2 posts)

  1. digitalartempire
    Member
    Posted 4 years ago #

    hey - I wante to redirect my http to www.

    at host gator they recommended using this

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^([a-z.]+)?example\.com$ [NC]
    RewriteCond %{HTTP_HOST} !^www\. [NC]
    RewriteRule .? http://www.%1example.com%{REQUEST_URI} [R=301,L]

    I added my url but it didnt work - can someone please who me using google .com as an example -

    thanks

  2. sparro
    Member
    Posted 4 years ago #

    You can do this through your WP options - you don't need to touch .htaccess.

    Here's how:

    1. Remove the code you've added to .htaccess.

    2. Make sure the htaccess file is writable (permissions: 777).

    3. Log in to WP and navigate to Settings > General. Where it says "wp location" and "wp url" (or similar), add the www.

    4. It'll log you out. Log back in and test it.

    If you can't log in, try this tutorial:


    Wordpress login page keeps reloading

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.