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

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > General > [solved] rewriterule moving from apacha to litespeed

Reply
 
Thread Tools Display Modes
  #1  
Old 03-24-2011, 07:35 PM
morrisqueto morrisqueto is offline
New Member
 
Join Date: Mar 2011
Posts: 7
Default [solved] rewriterule moving from apacha to litespeed

Here is my .htaccess
Code:
<IfModule mod_rewrite.c>
RewriteEngine on
Rewriterule ^busqueda/(.*)$ index.php?special=search&search=$1
Rewriterule ^index.html$ index.php
Rewriterule ^contacto.html$ index.php?special=contacto
Rewriterule ^sitemap.html$ index.php?special=sitemap
Rewriterule ^mapadelsitio.html$ index.php?special=sitemap
Rewriterule ^error-(.*).html$ index.php?special=error&error=$1
Rewriterule ^feed.xml$ feed.php

Rewriterule ^([0-9]+)-(.*)/$ index.php?category=$1
Rewriterule ^([0-9]+)-(.*)$ index.php?category=$1
Rewriterule ^ejemplos-(.*)/$ index.php?category2=$1
Rewriterule ^ejemplos-(.*)$ index.php?category2=$1
Rewriterule ^uploads/(.*)$ descargar.php?filename=$1
Rewriterule ^(.*)/([0-9]+)-(.*).html$ index.php?page=$2
Rewriterule ^tag/(.*)-([0-9]+).html$ index.php?tag=$1&tagpage=$2
Rewriterule ^tag/(.*).html$ index.php?tag=$1
</IfModule>

<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>
I noticed at least this line is not working

Rewriterule ^(.*)/([0-9]+)-(.*).html$ index.php?page=$2

Can anyone help me ?

Thanks a lot

Last edited by NiteWave; 06-28-2011 at 08:32 AM..
Reply With Quote
  #2  
Old 03-24-2011, 08:22 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,603
Nothing special. you should add "RewriteLogLevel 9" directive in <vritualhost> section for this vhost, then check error_log, see if you can figure it out.
Reply With Quote
  #3  
Old 03-24-2011, 10:31 PM
NiteWave NiteWave is online now
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,293
Code:
Rewriterule ^(.*)/([0-9]+)-(.*).html$ index.php?page=$2
best add [L] at end of the line.

e.g.,
Rewriterule ^(.*)/([0-9]+)-(.*).html$ index.php?page=$2 [L]

this applies to other rules -- add [L] if possible. this will improve the performance.
Reply With Quote
  #4  
Old 04-10-2011, 04:13 PM
morrisqueto morrisqueto is offline
New Member
 
Join Date: Mar 2011
Posts: 7
Thanks... can't make it work yet.
Reply With Quote
  #5  
Old 04-12-2011, 03:17 PM
webizen webizen is offline
LiteSpeed Staff
 
Join Date: Oct 2010
Posts: 2,390
There is no issue from our internal testing.
request to http://test/abc/999-456.html rewrite to /index.php?page=999 as shown below:
Quote:
2011-04-12 17:57:01.758 [INFO] [xxx.xxx.xxx.xxx:62738-0#Example] [REWRITE] Rule: Match 'abc/999-456.html' with pattern '^(.*)/([0-9]+)-(.*).html$', result: 4
2011-04-12 17:57:01.758 [INFO] [xxx.xxx.xxx.xxx:62738-0#Example] [REWRITE] Source URI: 'abc/999-456.html' => Result URI: 'index.php?page=999'
Please be more specific on what is not working. provide a URL in question and your rewrite log.
Reply With Quote
  #6  
Old 06-27-2011, 08:54 PM
morrisqueto morrisqueto is offline
New Member
 
Join Date: Mar 2011
Posts: 7
Made it work by changing the order in some of the rules.
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 01:25 AM.



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