Title: 404 errors caused by plugin &#8216;rewrite&#8217; rules
Last modified: April 15, 2025

---

# 404 errors caused by plugin ‘rewrite’ rules

 *  Resolved [LandyVlad](https://wordpress.org/support/users/landyvlad/)
 * (@landyvlad)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/404-errors-caused-by-plugin-rewrite-rules/)
 * I was suddenly getting 404 errors for almost all pages on the website I’m building(
   homepage excluded).
 * I couldn’t figure it out so I asked my host and it turned out not to be hosting
   related but they identified the following:
 * “The issue was because of the below code:
   `#Begin Really Simple Security<IfModule
   mod_rewrite.c>RewriteEngine onRewriteCond %{HTTP:X-Forwarded-Proto} !httpsRewriteCond%{
   REQUEST_URI} !^/\.well-known/acme-challenge/RewriteRule ^(.*)$ https://%{HTTP_HOST}/
   $1 [R=301,L]</IfModule>
 * I’ve commented these out and the pages are loading”.
 * Obviously I want to get the issue fixed at the source, and have the plugin working.
   Leaving it commented out is not the solution,
 * I’d appreciate guidance in resolving this matter.,
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2F404-errors-caused-by-plugin-rewrite-rules%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Support [Jarno Vos](https://wordpress.org/support/users/jarnovos/)
 * (@jarnovos)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/404-errors-caused-by-plugin-rewrite-rules/#post-18416663)
 * Hey [@landyvlad](https://wordpress.org/support/users/landyvlad/),
 * Is this the full `.htaccess` file of the affected website, or only the rules 
   from this plugin which you suspected to be related to the problem?
 * Because I think the issue you are experiencing is not specifically caused by 
   these rules from our plugin, but rather that the default WordPress `.htaccess`
   rules are no longer present in your configuration. WordPress relies on `.htaccess`
   rules to handle permalinks. If these rules are missing, WordPress can’t route
   requests correctly anymore; which will result in 404 errors for all pages except
   the homepage.
 * Usually this can be resolved easily by navigating to **Settings -> Permalinks**
   in the left-hand menu in the WordPress Admin Panel, and clicking the “**Save**”
   button on the page once (so, don’t make any changes to the Permalinks settings
   themselves; just click the “Save” button once).
 * This will write the default WordPress rules back to your .htaccess file and should
   fix the issue.
 * Kind regards, Jarno
 *  Thread Starter [LandyVlad](https://wordpress.org/support/users/landyvlad/)
 * (@landyvlad)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/404-errors-caused-by-plugin-rewrite-rules/#post-18417015)
 * The below is the htaccess file in my public html directory, as it stands now.
 *     ```wp-block-code
        #Begin Really Simple Security# <IfModule mod_rewrite.c># RewriteEngine on# RewriteCond %{HTTP:X-Forwarded-Proto} !https# RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/# RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]# </IfModule>#End Really Simple Security# BEGIN WordPress# The directives (lines) between "BEGIN WordPress" and "END WordPress" are# dynamically generated, and should only be modified via WordPress filters.# Any changes to the directives between these markers will be overwritten.<IfModule mod_rewrite.c>RewriteEngine OnRewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]RewriteBase /RewriteRule ^index\.php$ - [L]RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule . /index.php [L]</IfModule># END WordPressphp_value upload_max_filesize 138Mphp_value post_max_size 138Mphp_value max_execution_time 300php_value max_input_time 300# BEGIN LiteSpeed# The directives (lines) between "BEGIN LiteSpeed" and "END LiteSpeed" are# dynamically generated, and should only be modified via WordPress filters.# Any changes to the directives between these markers will be overwritten.<IfModule Litespeed>SetEnv noabort 1</IfModule># END LiteSpeed# php -- BEGIN cPanel-generated handler, do not edit# Set the “ea-php80” package as the default “PHP” programming language.<IfModule mime_module>  AddHandler application/x-httpd-ea-php80 .php .php8 .phtml</IfModule># php -- END cPanel-generated handler, do not edit
       ```
   
 * as you can see the Really Simple Security code at the top of the file is commented
   out.
 *  Plugin Support [Jarno Vos](https://wordpress.org/support/users/jarnovos/)
 * (@jarnovos)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/404-errors-caused-by-plugin-rewrite-rules/#post-18417048)
 * Hi [@landyvlad](https://wordpress.org/support/users/landyvlad/),
 * What I would do is re-enable the rules from Really Simple Security by uncommenting
   them, re-save the Permalinks settings as mentioned previously; and check if the
   issue is resolved by doing so.
 * If not, you can always revert to the ‘standard’ WordPress redirect **(301 PHP
   redirect)** instead of the .htaccess redirect, since this seems to be what causes
   the issue for you. Navigate to _Security -> Settings -> SSL_ and set it to 301
   PHP redirect instead.
 * Kind regards, Jarno
 *  Thread Starter [LandyVlad](https://wordpress.org/support/users/landyvlad/)
 * (@landyvlad)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/404-errors-caused-by-plugin-rewrite-rules/#post-18417169)
 * > What I would do is re-enable the rules from Really Simple Security by uncommenting
   > them, re-save the Permalinks settings as mentioned previously; and check if
   > the issue is resolved by doing so.
 * Didn’t work.
 * > If not, you can always revert to the ‘standard’ WordPress redirect **(301 PHP
   > redirect)** instead of the .htaccess redirect, since this seems to be what 
   > causes the issue for you. Navigate to _Security -> Settings -> SSL_ and set
   > it to 301 PHP redirect instead.
 * Did work! Thanks Jamo.
 * htaccess file now looks like this
 *     ```wp-block-code
       # BEGIN WordPress# The directives (lines) between "BEGIN WordPress" and "END WordPress" are# dynamically generated, and should only be modified via WordPress filters.# Any changes to the directives between these markers will be overwritten.<IfModule mod_rewrite.c>RewriteEngine OnRewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]RewriteBase /RewriteRule ^index\.php$ - [L]RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule . /index.php [L]</IfModule># END WordPressphp_value upload_max_filesize 138Mphp_value post_max_size 138Mphp_value max_execution_time 300php_value max_input_time 300# BEGIN LiteSpeed# The directives (lines) between "BEGIN LiteSpeed" and "END LiteSpeed" are# dynamically generated, and should only be modified via WordPress filters.# Any changes to the directives between these markers will be overwritten.<IfModule Litespeed>SetEnv noabort 1</IfModule># END LiteSpeed# php -- BEGIN cPanel-generated handler, do not edit# Set the “ea-php80” package as the default “PHP” programming language.<IfModule mime_module>  AddHandler application/x-httpd-ea-php80 .php .php8 .phtml</IfModule># php -- END cPanel-generated handler, do not edit
       ```
   

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘404 errors caused by plugin ‘rewrite’ rules’ is closed to new replies.

 * ![](https://ps.w.org/really-simple-ssl/assets/icon-256x256.png?rev=2839720)
 * [Really Simple Security - Simple and Performant Security (formerly Really Simple SSL)](https://wordpress.org/plugins/really-simple-ssl/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/really-simple-ssl/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/really-simple-ssl/)
 * [Active Topics](https://wordpress.org/support/plugin/really-simple-ssl/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/really-simple-ssl/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/really-simple-ssl/reviews/)

## Tags

 * [IfModule](https://wordpress.org/support/topic-tag/ifmodule/)
 * [RewriteEngine](https://wordpress.org/support/topic-tag/rewriteengine/)
 * [rewriterule](https://wordpress.org/support/topic-tag/rewriterule/)

 * 4 replies
 * 2 participants
 * Last reply from: [LandyVlad](https://wordpress.org/support/users/landyvlad/)
 * Last activity: [1 year, 1 month ago](https://wordpress.org/support/topic/404-errors-caused-by-plugin-rewrite-rules/#post-18417169)
 * Status: resolved