开发者

htaccess for cakephp [duplicate]

This question already has answers here: Closed 11 years ago.

Possibl开发者_如何学编程e 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/


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.


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.


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜