I'm a total newbie so please forgive if it's a stupid question but something weird is happening. I've added custom redirection rule to my .htaccess file RewriteRule ^/?hosts/(.*)$ /user/$1 [R,L]
. After some time, that rule is just gone from the .htaccess file. All other rules are in place. Only that rule gets removed. Any idea why?
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^/?hosts/(.*)$ /user/$1 [R,L]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Wordpress will rewrite everything between the # BEGIN WordPress
and # END WordPress
tags every time that permalinks are rebuilt.
Place your rule above the # BEGIN Wordpress
comment:
RewriteEngine On
RewriteRule ^/?hosts/(.*)$ /user/$1 [R,L]
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^/?hosts/(.*)$ /user/$1 [R,L]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>