0

Possible Duplicate:
.htaccess for cakephp

I use this code for htaccess

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule ^$ app/webroot/ [L]
    RewriteRule (.*) app/webroot/$1 [L]
</IfModule>

Inside this folder,

root/
app/
app/webroot

But not work

My live path is http://www.jacksonwebservices.co.uk/

Cœur
  • 37,241
  • 25
  • 195
  • 267
Sohel Rana
  • 111
  • 5

4 Answers4

2

you should be running with the default cake supplied .htaccess files. there is nothing wrong with them for the most part. it seems like the .htaccess files are not readable by the webserver.

check your logs for more info.

dogmatic69
  • 7,574
  • 4
  • 31
  • 49
1

Do you have that same .htaccess file in each of those directories? You need a different one in each of them. See http://book.cakephp.org/#!/view/917/Apache-and-mod_rewrite-and-htaccess for details.

JJJ
  • 32,902
  • 20
  • 89
  • 102
0

EDIT: DO AS JUHANA SAYS: Make sure you have the correct htaccess files in the correct locations. They are all different. If it is as you describe, webroot is redirecting to itself redirecting to itself redirecting ...

Does your website have mod_rewrite enabled?

Create a file that contains just this:

<?php
phpinfo();
?>

and save it as phpinfo.php in your document root (public_html, www or whatever)

Navigate to that page (http://www.jacksonwebservices.co.uk/phpinfo.php) and search the page for 'rewrite'. If you can't find it it's not enabled and CakePHP will not work in the default mode. See the manual for alternatives: http://book.cakephp.org/view/917/Apache-and-mod_rewrite-and-htaccess

You may need to contact your hosting to get it enabled or to find out how to do it yourself.

Leo
  • 6,553
  • 2
  • 29
  • 48
  • 1
    if mod_rewrite was not enabled the default / route would show with no css / images. other url's would show apache 404 errors – dogmatic69 Feb 07 '11 at 15:04
  • Yeah, you're probably right. If he has that .htaccess in webroot he'll get a 500 - it's looping. So he must have rewrite working. – Leo Feb 07 '11 at 19:34
0

I am guessing you are having the same Rewrite base problem that I recently had, put this in your .htaccess instead:

<IfModule mod_rewrite.c>
RewriteBase /
RewriteEngine on
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
</IfModule>

Sometimes it doesn't work without the 'RewriteBase' line at the top.

Dunhamzzz
  • 14,682
  • 4
  • 50
  • 74