Hi,
I am working on a Wordpress site, however I need to setup a rewrite rule so that if example.com/index.php?p=123 is requested, then 123.html is loaded, if not we should load Wordpress as normally.
I have the following rewrite rules that works perfectly using Apache, however in Litespeed instead of showing the expected 123.html file, a redirect is made from example.com/index.php?p=13 to example.com/?p=123 and loads the Wordpress page instead for 123.html
If I remove the second rewrite rules, and only have the first ones, so it is shown as below, the rewrite works as expected.
Any assistance with this? As mention the original rewrite rules work just fine using Apache, which is interesting.
Thanks
I am working on a Wordpress site, however I need to setup a rewrite rule so that if example.com/index.php?p=123 is requested, then 123.html is loaded, if not we should load Wordpress as normally.
I have the following rewrite rules that works perfectly using Apache, however in Litespeed instead of showing the expected 123.html file, a redirect is made from example.com/index.php?p=13 to example.com/?p=123 and loads the Wordpress page instead for 123.html
Code:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} index\.php
RewriteCond %{QUERY_STRING} ^id=([0-9]+)$
RewriteRule index.php %1.html? [QSA,L]
RewriteCond %{QUERY_STRING} =""
RewriteRule ^index\.php$ - [L]
RewriteCond %{QUERY_STRING} =""
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Code:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} index\.php
RewriteCond %{QUERY_STRING} ^id=([0-9]+)$
RewriteRule index.php %1.html? [QSA,L]
</IfModule>
# END WordPress
Thanks