I've been trying, yet again, to get mod_rewrite to work. Now i've gome
accros something that is to me (begin a apache AND mod_rewrite noob)
quite strange:

I have the following file:
C:/Program Files/Apache Group/Apache2/htdocs/cakePHP/app/
webroot/.htaccess with the following content:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>
When i hit http://localhost/ i get a directory listing off: :/Program
Files/Apache Group/Apache2/htdocs/cakePHP/app/webroot
This i think means that mod_rewrite is not functioning correclty.

BUT, now comes the crazy thing: when i change the file to:

C:/Program Files/Apache Group/Apache2/htdocs/cakePHP/app/
webroot/.htaccess with the following content:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^silly\.html$ /exists.html [L]
    RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>

I've added a second rewrite rule wich is a dummy rule (it makes
absolutely no sense :P) BUT when i now hit http://localhost/ i get my
CakePHP mainpage!!!

That indicates that mod_rewrite now is working. However, with this
little hack all images and styles dissapear. I googled it and i think
a .htaccess file can only have one rewrite rule.
Then howcome that the .htaccess file finally does what i needs to do
when i add a second rewrite rule? I think that something is wrong with
that file but i don't know what.

Help would be GREATLY appriciated!




On 8 jul, 14:38, Hitsugaya <[EMAIL PROTECTED]> wrote:
> I think they are. Just to be sure...there are .htaccess files in:
>
> C:/Program Files/Apache Group/Apache2/htdocs/cakePHP (the root folder
> of cakePHP). Content:
> <IfModule mod_rewrite.c>
>    RewriteEngine on
>    RewriteRule    ^$ app/webroot/    [L]
>    RewriteRule    (.*) app/webroot/$1 [L]
> </IfModule>
>
> C:/Program Files/Apache Group/Apache2/htdocs/cakePHP/app. Content:
> <IfModule mod_rewrite.c>
>     RewriteEngine on
>     RewriteRule    ^$    webroot/    [L]
>     RewriteRule    (.*) webroot/$1    [L]
>  </IfModule>
>
> C:/Program Files/Apache Group/Apache2/htdocs/cakePHP/app/webroot
> <IfModule mod_rewrite.c>
>     RewriteEngine On
>     RewriteCond %{REQUEST_FILENAME} !-d
>     RewriteCond %{REQUEST_FILENAME} !-f
>     RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
> </IfModule>
>
> All are left untouched, and the content seemes allright...
>
> Tnx for the relpy´s so far guys, hope we can solve this issue!
>
> On 8 jul, 13:44, "Jonathan Snook" <[EMAIL PROTECTED]> wrote:
>
>
>
> > Did the .htaccess files get copied properly?
>
> > > Jonathan // Im sure that the directory is my local cakephp. But the
> > > wierd thing is that withhttp://localhost/iget a directory listing
> > > and the index.php file is in that directory. That should point to
> > > mod_rewrite not being enabled but when i fire up phpinfo it states
> > > that mod_rewrite is one of the loaded modules.- Tekst uit oorspronkelijk 
> > > bericht niet weergeven -
>
> > - Tekst uit oorspronkelijk bericht weergeven -- Tekst uit oorspronkelijk 
> > bericht niet weergeven -
>
> - Tekst uit oorspronkelijk bericht weergeven -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to