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

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > Install/Configuration > rewrite issue

Reply
 
Thread Tools Display Modes
  #1  
Old 04-26-2012, 11:07 PM
accassar accassar is offline
Member
 
Join Date: Feb 2012
Posts: 31
Default rewrite issue

url: http://test.com/category/library

results in PHP 'no input file specified error'

url: http://test.com/index.php/category/library works

.htaccess rewrite rules:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

<IfModule mod_rewrite.c>
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
</IfModule>

<IfModule mod_rewrite.c>
RewriteRule "(^|/)\." - [F]
</IfModule>

logs:

2012-04-27 15:47:48.472 [INFO] [127.0.0.1:33137-0#test.com] [REWRITE] strip base: '/' from URI: '/category/library'
2012-04-27 15:47:48.472 [INFO] [127.0.0.1:33137-0#test.com] [REWRITE] Rule: Match 'category/library' with pattern '^(.*)$', result: 2
2012-04-27 15:47:48.472 [INFO] [127.0.0.1:33137-0#test.com] [REWRITE] Cond: Match '/category/library' with pattern '^system.*', result: -1
2012-04-27 15:47:48.472 [INFO] [127.0.0.1:33137-0#test.com] [REWRITE] Rule: Match 'category/library' with pattern '^(.*)$', result: 2
2012-04-27 15:47:48.472 [INFO] [127.0.0.1:33137-0#test.com] [REWRITE] Cond: Match '/category/library' with pattern '^application.*', result: -1
2012-04-27 15:47:48.472 [INFO] [127.0.0.1:33137-0#test.com] [REWRITE] Rule: Match 'category/library' with pattern '^(.*)$', result: 2
2012-04-27 15:47:48.472 [INFO] [127.0.0.1:33137-0#test.com] [REWRITE] stat( /clientdata/apache-www/s/h/test.com/www/category ) failed
2012-04-27 15:47:48.472 [INFO] [127.0.0.1:33137-0#test.com] [REWRITE] stat( /clientdata/apache-www/s/h/test.com/www/category ) failed
2012-04-27 15:47:48.472 [INFO] [127.0.0.1:33137-0#test.com] [REWRITE] Source URI: 'category/library' => Result URI: 'index.php/category/library'
2012-04-27 15:47:48.472 [INFO] [127.0.0.1:33137-0#test.com] [REWRITE] Last Rule, stop!
2012-04-27 15:47:48.472 [INFO] [127.0.0.1:33137-0#test.com] [REWRITE] prepend rewrite base: '/', final URI: '/index.php/category/library'
2012-04-27 15:47:48.472 [INFO] [127.0.0.1:33137-0#test.com] [REWRITE] strip base: '/' from URI: '/index.php/category/library'
2012-04-27 15:47:48.472 [INFO] [127.0.0.1:33137-0#test.com] [REWRITE] Rule: Match 'index.php/category/library' with pattern '^(.*)$', result: 2
2012-04-27 15:47:48.472 [INFO] [127.0.0.1:33137-0#test.com] [REWRITE] Cond: Match '/index.php/category/library' with pattern '^system.*', result: -1
2012-04-27 15:47:48.472 [INFO] [127.0.0.1:33137-0#test.com] [REWRITE] Rule: Match 'index.php/category/library' with pattern '^(.*)$', result: 2
2012-04-27 15:47:48.472 [INFO] [127.0.0.1:33137-0#test.com] [REWRITE] Cond: Match '/index.php/category/library' with pattern '^application.*', result: -1
2012-04-27 15:47:48.472 [INFO] [127.0.0.1:33137-0#test.com] [REWRITE] Rule: Match 'index.php/category/library' with pattern '^(.*)$', result: 2
2012-04-27 15:47:48.472 [INFO] [127.0.0.1:33137-0#test.com] [REWRITE] Cond: test '/clientdata/apache-www/s/h/test.com/www/index.php' with pattern '-f', result: 0
2012-04-27 15:47:48.472 [INFO] [127.0.0.1:33137-0#test.com] [REWRITE] Rule: Match 'index.php/category/library' with pattern '^(.*)$', result: 2
2012-04-27 15:47:48.472 [INFO] [127.0.0.1:33137-0#test.com] [REWRITE] Cond: Compare 'off' with pattern 'on', result: -1
2012-04-27 15:47:48.472 [INFO] [127.0.0.1:33137-0#test.com] [REWRITE] Cond: Match 'test.com' with pattern '^www\.(.+)$', result: -1
2012-04-27 15:47:48.472 [INFO] [127.0.0.1:33137-0#test.com] [REWRITE] Rule: Match 'index.php/category/library' with pattern '(^|/)\.', result: -1
2012-04-27 15:47:48.472 [INFO] [127.0.0.1:33137-0#test.com] [REWRITE] strip base: '/' from URI: '/index.php/category/library'
2012-04-27 15:47:48.472 [INFO] [127.0.0.1:33137-0#test.com] [REWRITE] Rule: Match 'index.php/category/library' with pattern '^(.*)$', result: 2
2012-04-27 15:47:48.472 [INFO] [127.0.0.1:33137-0#test.com] [REWRITE] Cond: Match '/index.php/category/library' with pattern '^system.*', result: -1
2012-04-27 15:47:48.472 [INFO] [127.0.0.1:33137-0#test.com] [REWRITE] Rule: Match 'index.php/category/library' with pattern '^(.*)$', result: 2
2012-04-27 15:47:48.472 [INFO] [127.0.0.1:33137-0#test.com] [REWRITE] Cond: Match '/index.php/category/library' with pattern '^application.*', result: -1
2012-04-27 15:47:48.472 [INFO] [127.0.0.1:33137-0#test.com] [REWRITE] Rule: Match 'index.php/category/library' with pattern '^(.*)$', result: 2
2012-04-27 15:47:48.472 [INFO] [127.0.0.1:33137-0#test.com] [REWRITE] Cond: test '/clientdata/apache-www/s/h/test.com/www/index.php' with pattern '-f', result: 0
2012-04-27 15:47:48.472 [INFO] [127.0.0.1:33137-0#test.com] [REWRITE] Rule: Match 'index.php/category/library' with pattern '^(.*)$', result: 2
2012-04-27 15:47:48.473 [INFO] [127.0.0.1:33137-0#test.com] [REWRITE] Cond: Compare 'off' with pattern 'on', result: -1
2012-04-27 15:47:48.473 [INFO] [127.0.0.1:33137-0#test.com] [REWRITE] Cond: Match 'test.com' with pattern '^www\.(.+)$', result: -1
2012-04-27 15:47:48.473 [INFO] [127.0.0.1:33137-0#test.com] [REWRITE] Rule: Match 'index.php/category/library' with pattern '(^|/)\.', result: -1
Reply With Quote
  #2  
Old 04-27-2012, 12:44 AM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,216
how about change
Quote:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
to

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1 [L]
</IfModule>
Reply With Quote
  #3  
Old 04-27-2012, 12:59 AM
accassar accassar is offline
Member
 
Join Date: Feb 2012
Posts: 31
Thanks that worked. Why doesn't it work with the '/' but with the '?' ?

I have a large number of virtualhosts to convert and am worried about little rewrite issues like this.
Reply With Quote
  #4  
Old 04-27-2012, 01:09 AM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,216
good news. have you tried on apache? if not working under apache, then the rewriterule not written properly.
Reply With Quote
  #5  
Old 04-27-2012, 01:16 AM
accassar accassar is offline
Member
 
Join Date: Feb 2012
Posts: 31
yes the rewrite rule worked on apache.

why did the ? work and not the /, i imaging it's a fairly common rewrite?

Quote:
Originally Posted by NiteWave View Post
good news. have you tried on apache? if not working under apache, then the rewriterule not written properly.
Reply With Quote
Reply

Tags
htaccess, rewrite

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 05:02 AM.



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