LiteSpeed Support Forums

LiteSpeed Support Forums (http://www.litespeedtech.com/support/forum/index.php)
-   Apache Migration/Compatibility (http://www.litespeedtech.com/support/forum/forumdisplay.php?f=24)
-   -   [solved] Mod_rewrite rules not working in litespeed. Works in Apache (http://www.litespeedtech.com/support/forum/showthread.php?t=4934)

peterpiper812 04-25-2011 08:37 PM

Mod_rewrite rules not working in litespeed. Works in Apache
 
This set of rules is not working:

Code:

  RewriteRule ^index\.html /index.php
  RewriteRule ^([a-zA-Z0-9_=+-]+)(/|\.html)$ modules=$1 [L,S=5]
  RewriteRule ^([a-zA-Z0-9_=+-]+)/([a-zA-Z0-9_]+)(/|\.html)$ modules=$1&file=$2 [L,S=4]
  RewriteRule ^([a-zA-Z0-9_=+-]+)/([a-zA-Z0-9_]+)$ modules=$1&file=$2 [L,S=3]
  RewriteRule ^([a-zA-Z0-9_=+-]+)/([a-zA-Z0-9_]+)/(.*)(/|\.html)$ modules=$1&file=$2&$3 [L,S=1]
  RewriteRule ^([a-zA-Z0-9_=+-]+)/(.*)(/|\.html)$ modules=$1&file=index&$2  [L]
  RewriteRule ^modules=(.*[^/])/(.*) modules=$1&$2 [N,L]
  RewriteRule ^modules=(.*) modules.php?name=$1 [L]

The Info from Admin:

Code:

[x.x.x.x:51058-0#test.com] [REWRITE] Rule: Match '/Forums.html' with pattern '^index\.html', result: -1
[x.x.x.x:51058-0#test.com] [REWRITE] Rule: Match '/Forums.html' with pattern '^([a-zA-Z0-9_=+-]+)(/|\.html)$', result: -1
[x.x.x.x:51058-0#test.com] [REWRITE] Rule: Match '/Forums.html' with pattern '^([a-zA-Z0-9_=+-]+)/([a-zA-Z0-9_]+)(/|\.html)$', result: -1
[x.x.x.x:51058-0#test.com] [REWRITE] Rule: Match '/Forums.html' with pattern '^([a-zA-Z0-9_=+-]+)/([a-zA-Z0-9_]+)$', result: -1
[x.x.x.x:51058-0#test.com] [REWRITE] Rule: Match '/Forums.html' with pattern '^([a-zA-Z0-9_=+-]+)/([a-zA-Z0-9_]+)/(.*)(/|\.html)$', result: -1
[x.x.x.x:51058-0#test.com] [REWRITE] Rule: Match '/Forums.html' with pattern '^([a-zA-Z0-9_=+-]+)/(.*)(/|\.html)$', result: -1
[x.x.x.x:51058-0#test.com] [REWRITE] Rule: Match '/Forums.html' with pattern '^modules=(.*[^/])/(.*)', result: -1
[x.x.x.x:51058-0#test.com] [REWRITE] Rule: Match '/Forums.html' with pattern '^modules=(.*)', result: -1
[x.x.x.x:51058-0#test.com] File not found [/test.com/public/Forums.html]

It isnt make it to te last rule for some reason. Anyone see anything wrong?

/Forums.html should go to modules.php?name=Forums

NiteWave 04-25-2011 09:21 PM

please try
Quote:

RewriteRule ^index\.html /index.php
RewriteRule ^([a-zA-Z0-9_=+-]+)(/|\.html)$ modules=$1 [S=5]
RewriteRule ^([a-zA-Z0-9_=+-]+)/([a-zA-Z0-9_]+)(/|\.html)$ modules=$1&file=$2 [S=4]
RewriteRule ^([a-zA-Z0-9_=+-]+)/([a-zA-Z0-9_]+)$ modules=$1&file=$2 [S=3]
RewriteRule ^([a-zA-Z0-9_=+-]+)/([a-zA-Z0-9_]+)/(.*)(/|\.html)$ modules=$1&file=$2&$3 [S=1]
RewriteRule ^([a-zA-Z0-9_=+-]+)/(.*)(/|\.html)$ modules=$1&file=index&$2
RewriteRule ^modules=(.*[^/])/(.*) modules=$1&$2
RewriteRule ^modules=(.*) modules.php?name=$1 [L]

peterpiper812 04-25-2011 09:32 PM

That seems to have fixed it. Thank you.

peterpiper812 04-25-2011 10:14 PM

Spoke too soon.

This ('/Forums/posting/mode=reply/t=11.html') should goto

modules.php?name=Forums&file=posting&mode=reply&t= 11

From Admin:

Code:

2011-04-26 00:07:58.662 INFO [x.x.x.x:53057-0#test.com] [REWRITE] Rule: Match 'Forums/posting/mode=reply/t=11.html' with pattern '^index\.html', result: -1
2011-04-26 00:07:58.662 INFO [x.x.x.x:53057-0#test.com] [REWRITE] Rule: Match 'Forums/posting/mode=reply/t=11.html' with pattern '^([a-zA-Z0-9_=+-]+)(/|\.html)$', result: -1
2011-04-26 00:07:58.662 INFO [x.x.x.x:53057-0#test.com] [REWRITE] Rule: Match 'Forums/posting/mode=reply/t=11.html' with pattern '^([a-zA-Z0-9_=+-]+)/([a-zA-Z0-9_]+)(/|\.html)$', result: -1
2011-04-26 00:07:58.662 INFO [x.x.x.x:53057-0#test.com] [REWRITE] Rule: Match 'Forums/posting/mode=reply/t=11.html' with pattern '^([a-zA-Z0-9_=+-]+)/([a-zA-Z0-9_]+)$', result: -1
2011-04-26 00:07:58.662 INFO [x.x.x.x:53057-0#test.com] [REWRITE] Rule: Match 'Forums/posting/mode=reply/t=11.html' with pattern '^([a-zA-Z0-9_=+-]+)/([a-zA-Z0-9_]+)/(.*)(/|\.html)$', result: 5
2011-04-26 00:07:58.662 INFO [x.x.x.x:53057-0#test.com] [REWRITE] Source URI: 'Forums/posting/mode=reply/t=11.html' => Result URI: 'modules=Forums&file=posting&mode=reply/t=11'
2011-04-26 00:07:58.662 INFO [x.x.x.x:53057-0#test.com] [REWRITE] skip next 1 rules
2011-04-26 00:07:58.662 INFO [x.x.x.x:53057-0#test.com] [REWRITE] Rule: Match 'modules=Forums&file=posting&mode=reply/t=11' with pattern '^modules=(.*[^/])/(.*)', result: 3
2011-04-26 00:07:58.662 INFO [x.x.x.x:53057-0#test.com] [REWRITE] Source URI: 'modules=Forums&file=posting&mode=reply/t=11' => Result URI: 'modules=Forums&file=posting&mode=reply&t=11'
2011-04-26 00:07:58.662 INFO [x.x.x.x:53057-0#test.com] [REWRITE] Last Rule, stop!
2011-04-26 00:07:58.662 INFO [x.x.x.x:53057-0#test.com] [REWRITE] prepend rewrite base: '/', final URI: '/modules=Forums&file=posting&mode=reply&t=11'
2011-04-26 00:07:58.662 INFO [x.x.x.x:53057-0#test.com] File not found [/test.com/public/modules=Forums&file=posting&mode=reply&t=11]

I think is becuase the L was removed.

NiteWave 04-25-2011 10:18 PM

please try
Quote:

RewriteRule ^modules=(.*[^/])/(.*) modules=$1&$2
to
Quote:

RewriteRule ^modules=(.*[^/])/(.*) modules=$1&$2 [N]

peterpiper812 04-27-2011 08:14 PM

Sorry for the delayed response.

This appears to have fixed it.


All times are GMT -7. The time now is 01:44 AM.