I’ve used some custom rewrites implemented by the Roots framework. Occasionally they get wiped: certainly if I visit Settings > Permalinks, but also at seemingly random times.
My htaccess reads so:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteRule ^css/(.*) /wp-content/themes/the-hit-centre/css/$1 [QSA,L]
RewriteRule ^js/(.*) /wp-content/themes/the-hit-centre/js/$1 [QSA,L]
RewriteRule ^img/(.*) /wp-content/themes/the-hit-centre/images/$1 [QSA,L]
RewriteRule ^plugins/(.*) /wp-content/plugins/$1 [QSA,L]
RewriteRule ^media/(.*) /wp-content/uploads/$1 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
I’ve tried removing the
# BEGIN WordPress
comments, but then WP just writes a new block of code.
Is there a hook I can call in functions.php that will prevent WP refreshing the permalinks?
thanks, Tim
There is a
# BEGIN WordPress
and# END WordPress
after the end you should be able to add your own code. Anything between will get overwritten by WordPress