Hello, i have a code JohnCMS with rewrite-rule as follows :
It does not work on Openlitespeed 1.3.6 (404 not found)
Note: It can run on Nginx with the following rules :
So what's wrong with rewrite-rule, how to run it on Openlitespeed? Thanks all!^^
Code:
Options -Indexes
ErrorDocument 403 /index.php
ErrorDocument 404 http://m.domain.com
ErrorDocument 500 /index.php
DirectoryIndex index.php
AddDefaultCharset UTF-8
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault A1209600
<FilesMatch \.php$>
ExpiresActive Off
</FilesMatch>
</IfModule>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.m.domain.com$
RewriteRule (.*) http://m.domain.com/$1 [R=301,L]
RewriteRule robots.txt robot.php
RewriteCond %{REQUEST_METHOD} ^TRACE
RewriteCond %{HTTP:range} !(^bytes=[^,]+(,[^,]+){0,4}$|^$)
RewriteRule .* - [F]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-zA-Z0-9_-]+)$ http://m.domain.com/$1/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([0-9]+)/$ index.php?page=$1 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^tags/(.*).([0-9]+)/$ forum/tag.php?search=$1&page=$2 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^tags/(.*)/$ forum/tag.php?search=$1 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-zA-Z0-9_-]+)/$ forum/index.php?url=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-zA-Z0-9_-]+)/([0-9]+)$ http://m.domain.com/$1/$2/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-zA-Z0-9_-]+)/([0-9]+)/$ forum/index.php?url=$1&page=$2 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^tags/([a-zA-Z0-9_+-]+)$ http://m.domain.com/tags/$1/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^page/([a-zA-Z0-9_-]+)/$ forum/page.php?url=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^tags/([a-zA-Z0-9_+-]+)$ http://m.domain.com/tags/$1/ [R=301,L]
Note: It can run on Nginx with the following rules :
Code:
rewrite robots.txt /robot.php;
rewrite ^/([a-zA-Z0-9_-]+)$ http://m.domain.com/$1/ redirect;
rewrite ^/([0-9]+)/$ /index.php?page=$1 break;
rewrite ^/tags/(.*).([0-9]+)/$ /forum/tag.php?search=$1&page=$2 break;
rewrite ^/tags/(.*)/$ /forum/tag.php?search=$1 break;
rewrite ^/([a-zA-Z0-9_-]+)/$ /forum/index.php?url=$1 break;
rewrite ^/([a-zA-Z0-9_-]+)/([0-9]+)$ http://m.domain.com/$1/$2/ redirect;
rewrite ^/([a-zA-Z0-9_-]+)/([0-9]+)/$ /forum/index.php?url=$1&page=$2 break;
rewrite ^/tags/([a-zA-Z0-9_+-]+)$ http://domain.com/tags/$1/ redirect;
rewrite ^/page/([a-zA-Z0-9_-]+)/$ /forum/page.php?url=$1 break;
rewrite ^/tags/([a-zA-Z0-9_+-]+)$ http://m.domain.com/tags/$1/ redirect;
So what's wrong with rewrite-rule, how to run it on Openlitespeed? Thanks all!^^