Forum Moderators: rogerd & travelin cat
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>
# END WordPress
[edited by: lee_sufc at 3:48 pm (utc) on Apr 23, 2017]
WordPress uses this file to manipulate how Apache serves files from its root directory, and subdirectories thereof. Most notably, WP modifies this file to be able to handle pretty permalinks.[codex.wordpress.org ]WP Codex
On the Settings->General screen in a single site installation of WordPress, there are two fields named "WordPress Address (URL)" and "Site Address (URL)". They are important settings, since they control where WordPress thinks your site is located. They control the display of the URL in the admin section of your page, as well as the front end, and are used throughout the WordPress code.[codex.wordpress.org ]
The "Site Address (URL)" setting is the address you want people to type in their browser to reach your WordPress blog.
The "WordPress Address (URL)" setting is the address where your WordPress core files reside.
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule> RewriteBase /blog/ in it, it should work fine from the root directory. When WP updates, it can rewrite a new htaccess if it does not find one in the folder of its Settings URL, that may happen again.
RewriteEngine On
RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$ [OR]
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://www.example.com/$1 [R=301,L] then you should also have RewriteEngine On
RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$ [OR]
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://www.example.com/blog/$1 [R=301,L]