+1 vote
in Web & Google by (60.5k points)
I want to install WordPress in a directory (e.g., blogs). What changes should I make in the .htaccess file?

1 Answer

+2 votes
by (256k points)
selected by
 
Best answer

You need to update "RewriteBase" and "RewriteRule" if you want to install WordPress in a directory.

For example, if I want to install WordPress in the "blogs" folder, the ".htaccess" file should look like the following (changes are highlighted).

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteBase /blogs/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /blogs/index.php [L]
</IfModule>


...