I have been having difficulties with redirecting query strings for the new WordPress site we launched.

I am using mod_rewrites to do the redirect and I can get them to work by removing the [L] flag from the WordPress index.php mod_rewrite (see below).

# 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]

# END WordPress

Complete .htaccess

The problem that I am having is that the flag keep getting put back and so need to know how I can change the WordPress .htaccess output while still allowing for updates etc.

Any help would be appreciated.

  • 1
    Remove write access for the PHP user on the system. – fuxia Nov 22 '16 at 8:40
  • @toscho, I'm curious if there's a reason not to use the mod_rewrite_rules filter and do a string replacement to remove the flags. – Dave Romsey Nov 22 '16 at 10:10
  • 1
    @DaveRomsey Too slow, might not work in the future, unnecessary complex solution for a simple problem. – fuxia Nov 22 '16 at 10:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.