Forum Topic: mod_rewrite question in htaccess WP template

Forum: .htaccess Forum : WordPress • Posted by Yael Miller • Updated:

On Line 59 of the htaccess WP template, it has the below:

# Enable mod_rewrite
<IfModule mod_rewrite.c>
	RewriteEngine On
</IfModule>

I’m confused: Isn’t mod_rewrite already enabled with lines 7-14?

<IfModule mod_rewrite.c>
	RewriteEngine On
	RewriteBase /wordpress/
	RewriteRule ^index\.php$ - [L]
	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteCond %{REQUEST_FILENAME} !-d
	RewriteRule . /wordpress/index.php [L]
</IfModule>

2 Replies to “mod_rewrite question in htaccess WP template”

Posted by Jeff Starr

Yes, but it’s fine to include that directive multiple times – Apache ignores it once mod_rewrite is enabled. I left it in the WP rules for modularity of the code, so everything is intact if it needs to be moved or used elsewhere. Feel free to remove one or the other (or both if mod_rewrite is already enabled via config).

Posted by Yael Miller •

Thanks for explaining.