rewrite rule issue

pardis

Well-Known Member
#1
I use rewrite rule for my own project , but this code not work on lsws. (Apache working)
please check code and see is there any mismatch with lsws.

Code:
RewriteEngine On

RewriteRule (\d+)/(\d+)/$ /?cat_id=$1&section=$2 [S]
RewriteRule (\d+)/(\d+)$ /?cat_id=$1&section=$2 [S]

RewriteRule skilled/(\d+)/$ /?action=skilled&post_id=$1 [S]
RewriteRule skilled/(\d+)$ /?action=skilled&post_id=$1 [S]

RewriteRule notes/(\d+)/$ /?action=notes&post_id=$1 [S]
RewriteRule notes/(\d+)$ /?action=notes&post_id=$1 [S]

RewriteRule notes$ /?action=notes [S]
RewriteRule notes/$ /?action=notes [S]

RewriteRule relation/(\d+)/$ /?action=relation&post_id=$1 [S]
RewriteRule relation/(\d+)$ /?action=relation&post_id=$1 [S]

RewriteRule relation$ /?action=relation [S]
RewriteRule relation/$ /?action=relation [S]

RewriteRule others/(\d+)/$ /?action=others&post_id=$1 [S]
RewriteRule others/(\d+)$ /?action=others&post_id=$1 [S]

RewriteRule others$ /?action=others [S]
RewriteRule others/$ /?action=others [S]

RewriteRule news/(\d+)/$ /?action=news&post_id=$1 [S]
RewriteRule news/(\d+)$ /?action=news&post_id=$1 [S]

RewriteRule article/(\d+)/$ /?action=article&post_id=$1 [S]
RewriteRule article/(\d+)$ /?action=article&post_id=$1 [S]

RewriteRule activate/(.{2,})/(\d+)/$ /?action=activate&user_name=$1&code=$2 [S]
RewriteRule activate/(.{2,})/(\d+)$ /?action=activate&user_name=$1&code=$2 [S]



RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
 

NiteWave

Administrator
#2
Code:
RewriteRule (\d+)/(\d+)/$ /?cat_id=$1&section=$2 [S]
RewriteRule (\d+)/(\d+)$ /?cat_id=$1&section=$2 [S]

can be simplified as

RewriteRule (\d+)/(\d+)/?$ /?cat_id=$1&section=$2

this can apply for other similar rewrite rules, as result, all flag [S] are removed.

see if works on both litespeed and apache.
 
Top