WordPress.org

Support

Support » How-To and Troubleshooting » .htaccess – redirect

.htaccess – redirect

  • 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

Viewing 1 replies (of 1 total)
  • 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

Viewing 1 replies (of 1 total)
  • The topic ‘.htaccess – redirect’ is closed to new replies.
Skip to toolbar