Page 1 of 1

Can't get mod_rewrite to work...

Posted: Wed Dec 07, 2005 6:55 pm
by Hernan
I can't get mod_rewrite to work. I get a "400 Bad Request" message when I try to access the content pages.

This is the configuration:
-Apache 2, Windows XP
-I turned on assume_mod_rewrite in config.php
-In httpd.conf I added this:

Code: Select all

Alias /seiscuerdas "C:/Inetpub/seiscuerdas/"
<Directory "C:/Inetpub/seiscuerdas">
   Options FollowSymLinks
   AllowOverride All
   Order allow,deny
   Allow from all
</Directory>
-In .htaccess I have this:

Code: Select all

php_flag magic_quotes_gpc Off
php_flag register_globals Off
php_flag session.use_trans_sid Off

# Make sure you have Options FollowSymLinks
# and Allow on
RewriteEngine On

#Rewrites page.shtml as index.php?page
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteRule ^(.+)\.html$ index.php?page=$1 [QSA]
-I turned mod_rewrite logging  on and this is what I get:

Code: Select all

127.0.0.1 - - [07/Dec/2005:10:36:04 --0800] [localhost/sid#3bf30][rid#13da890/initial] (3) [per-dir C:/Inetpub/seiscuerdas/] strip per-dir prefix: C:/Inetpub/seiscuerdas/Guitarristas.html -> Guitarristas.html
127.0.0.1 - - [07/Dec/2005:10:36:04 --0800] [localhost/sid#3bf30][rid#13da890/initial] (3) [per-dir C:/Inetpub/seiscuerdas/] applying pattern '^(.+)\.html$' to uri 'Guitarristas.html'
127.0.0.1 - - [07/Dec/2005:10:36:04 --0800] [localhost/sid#3bf30][rid#13da890/initial] (2) [per-dir C:/Inetpub/seiscuerdas/] rewrite Guitarristas.html -> index.php?page=Guitarristas
127.0.0.1 - - [07/Dec/2005:10:36:04 --0800] [localhost/sid#3bf30][rid#13da890/initial] (3) split uri=index.php?page=Guitarristas -> uri=index.php, args=page=Guitarristas
127.0.0.1 - - [07/Dec/2005:10:36:04 --0800] [localhost/sid#3bf30][rid#13da890/initial] (3) [per-dir C:/Inetpub/seiscuerdas/] add per-dir prefix: index.php -> C:/Inetpub/seiscuerdas/index.php
127.0.0.1 - - [07/Dec/2005:10:36:04 --0800] [localhost/sid#3bf30][rid#13da890/initial] (1) [per-dir C:/Inetpub/seiscuerdas/] internal redirect with C:/Inetpub/seiscuerdas/index.php [INTERNAL REDIRECT]
I run out of ideas, I don't know what else to try. Thanks!

Hernan.

Re: Can't get mod_rewrite to work...

Posted: Tue Dec 20, 2005 11:12 pm
by Michael

Code: Select all

php_flag magic_quotes_gpc Off
php_flag register_globals Off
php_flag session.use_trans_sid Off

Options FollowSymLinks
Allow from all

# Make sure you have Options FollowSymLinks
# and Allow on
RewriteEngine On

#Rewrites page.shtml as index.php?page
RewriteCond % !-f [NC]
RewriteRule ^(.+)\.html$ index.php?page=$1 [QSA]
# Make sure you have Options FollowSymLinks
# and Allow on
that is what it says.. so you can better do it:)