• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error in the current documentation


Current version:

RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

It must be
RewriteEngine on
RewriteCond $1 !^/(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

[eluser]louis w[/eluser]
I'm not sure this is always the case. What platform are you on?

Have you tried using
RewriteBase /

I've tried add line RewriteBase / into my vhosts config file

The result is

Quote:#service myapache restart
restarting myApache daemon
Syntax error on line 69 of /server/apache2/conf/extra/httpd-vhosts.conf:
RewriteBase: only valid in per-directory config files

My system
Quote:Ubuntu Linux 2.6.27-11-generic

Manually builded Apache
Server version: Apache/2.2.9 (Unix)
Server built: Aug 1 2008 16:49:43

My config
Quote:<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "/server/www/example.com/htdocs"
ServerName example.com
ServerAlias www.example.com

RewriteEngine on
# RewriteBase /
RewriteCond $1 !^/(index\.php|mp3|swf|js|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

ErrorLog "logs/example.com-error_log"
CustomLog "logs/example.com-access_log" common

[eluser]louis w[/eluser]
Have you tried entering this information in an htaccess file instead?

I have no htaccess file and i have no reason to make it.

[eluser]louis w[/eluser]
Not even to see if it would work or not?

I prefer to manage my mod_rewrite through an htaccess file. It makes a site more self contained as well as makes the rules less transparent.

I believe it's telling you to add a <Directory ...> declaration in your conf.

Yep it works.
<Directory /server/www/example.com/htdocs>
RewriteEngine on
# RewriteBase /
RewriteCond $1 !^(index\.php|mp3|swf|js|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

May be this information must be in manual?

[eluser]louis w[/eluser]
Glad you got it working.

The information in the manual is aimed towards people doing this in their htaccess, which doesn't require <Directory ..>. I think they were trying to keep things as simple as possible so it would be easier to implement. Many people don't have access to apache or virtual host config files.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.