LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > External Applications > Apache Migration/Compatibility > rewrite problem ?

Reply
 
Thread Tools Display Modes
  #1  
Old 09-17-2009, 10:13 AM
art182 art182 is offline
Member
 
Join Date: Oct 2006
Posts: 15
Default rewrite problem ?

hello, i have simple rewrite rules


RewriteRule ^example/(.*)/(.*)$ /x.php?s=example&n=$1&p=$2 [L]
RewriteRule ^example/(.*)$ /x.php?s=example&n=$1 [L]
RewriteRule ^ex2/(.*)/(.*)$ /x.php?s=ex2&n=$1&p=$2 [L]
RewriteRule ^ex2/(.*)$ /x.php?s=ex2&n=$1 [L]

domain.pl / x.php
I need rewrite domain.pl/example, domain.pl/ex2 etc.


why its not working ? ( error 404 )
on apache is ok.
Reply With Quote
  #2  
Old 09-17-2009, 10:20 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,583
You rewrite rule should work, maybe something else.
Are you using LSWS standard edition with httpd.conf?
Reply With Quote
  #3  
Old 09-17-2009, 10:59 AM
art182 art182 is offline
Member
 
Join Date: Oct 2006
Posts: 15
no using httpd.conf
standard edition ( 4.0.10 )
logs:
Quote:
2009-09-11 20:52:37.224 [INFO] [62.152.144.149:16444-0#kage.pl] [REWRITE] Rule: Match '/bleach/baundo/' with pattern '^bleach/(.*)/(.*)$', result: -1
2009-09-11 20:52:37.224 [INFO] [62.152.144.149:16444-0#kage.pl] [REWRITE] Rule: Match '/bleach/baundo/' with pattern '^bleach/(.*)$', result: -1
2009-09-11 20:52:37.224 [INFO] [62.152.144.149:16444-0#kage.pl] [REWRITE] Rule: Match '/bleach/baundo/' with pattern '^dragon/(.*)/(.*)$', result: -1
2009-09-11 20:52:37.224 [INFO] [62.152.144.149:16444-0#kage.pl] [REWRITE] Rule: Match '/bleach/baundo/' with pattern '^dragon/(.*)$', result: -1
2009-09-11 20:52:37.224 [INFO] [62.152.144.149:16444-0#kage.pl] File not found [/home/ssjcenter/public_html/bleach/baundo/]
Reply With Quote
  #4  
Old 09-17-2009, 02:38 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,583
If you copy the rewrite rule from .htaccess to use it at vhost level, you need to add a leading '/', the log shows it as well.
Reply With Quote
  #5  
Old 09-18-2009, 01:02 AM
art182 art182 is offline
Member
 
Join Date: Oct 2006
Posts: 15
sorry i don't understand ..

where should I add / ?

( could you show me an example? )
Reply With Quote
  #6  
Old 09-18-2009, 02:37 AM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,216
RewriteRule ^example/(.*)/(.*)$ /x.php?s=example&n=$1&p=$2 [L]

===>

RewriteRule ^/example/(.*)/(.*)$ /x.php?s=example&n=$1&p=$2 [L]
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 03:22 AM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.