|
|

04-26-2012, 11:07 PM
|
|
Member
|
|
Join Date: Feb 2012
Posts: 31
|
|
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
|

04-27-2012, 12:44 AM
|
|
LiteSpeed Staff
|
|
Join Date: Sep 2009
Posts: 2,226
|
|
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>
|

04-27-2012, 12:59 AM
|
|
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.
|

04-27-2012, 01:09 AM
|
|
LiteSpeed Staff
|
|
Join Date: Sep 2009
Posts: 2,226
|
|
|
good news. have you tried on apache? if not working under apache, then the rewriterule not written properly.
|

04-27-2012, 01:16 AM
|
|
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
good news. have you tried on apache? if not working under apache, then the rewriterule not written properly.
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 06:37 PM.
|
|