Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

share|improve this question

1 Answer 1

up vote 0 down vote accepted

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

share|improve this answer
    
example code here whypad.com/posts/… –  Drai Mar 1 '12 at 22:50
    
Thanks Drai - I'll follow whypad's lead and double up on the <IfModule, RewriteEngine On business.. The other approach I considered was to set .htaccess as not writable... Thanks! –  memeLab Mar 2 '12 at 5:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.