Support » Fixing WordPress » .htaccess Redirect Question

  • Hey everyone,

    This is the scenario. index.html in the root, WP installed in /blog.

    I normally install WP in the root and use the following code in the root .htaccess file to redirect all non-www traffic to www:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} !^www\.domain\.com$ [NC]
    RewriteRule ^(.*)$$1 [R,L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    # END WordPress

    My question is, how do I do the same thing with my URL’s now that WP is installed in a subfolder?

    Many thanks in advance!


Viewing 3 replies - 1 through 3 (of 3 total)
  • Anyone?

    Take out the www part from “WordPress begin” section, and WP will rewrite only what is in between Start and End.
    Don’t forget, your WP htaccess MUST be in the subfolder where you installed WP.

    Another way would be to edit the lines
    RewriteBase /whatever
    RewriteRule . /whatever/index.php [L]

    Moderator Samuel Wood (Otto)

    (@otto42) Admin

    What moshu said:

    1. Edit the .htaccess in your wordpress folder to not have the www lines. Then update your permalinks so that WordPress will rewrite the .htaccess file correctly. It will be different now that it’s in a subfolder.
    2. Make an .htaccess in the root with only those www lines.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘.htaccess Redirect Question’ is closed to new replies.