Reputation: 22071
I am using CakePHP 1.3
on my LAMP Environment
for one of my project, and what shocked me suddenly about my website path issue for URL:
Its coming like this :
http://localhost/project/app/webroot/index.php/mydocuments/
While till now it was coming properly like:
http://localhost/project/mydocuments/
But I really don't know, what settings altered to cause this path issue.
I have 3 default .htaccess files which CakePHP provides like my folder structure is, one htaccess file is in root folder (outside app folder), one htaccess file into app folder and one more into app/webroot folder as you've described here, but still its path is the issue..
Upvotes: 0
Views: 1046
Reputation: 34837
I second what wrdevos is saying. On top of that, also make sure that under the Directory directive of your documentroot (in your Apache config) the option AllowOverride is set to All, like this:
<Directory "/var/www/html">
AllowOverride All
# Other options should follow...
</Directory>
On most systems it defaults to AllowOverride None, which doesn't allow .htaccess files to be run at all.
Upvotes: 1
Reputation: 2069
I am assuming you use Apache and your Apache docroot is points to your app/webroot folder.
You need a .htaccess file in your webroot dir to make this work on Apache.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>
If your Apache docroot is your app root (not recommended) you need another .htaccess file like this in your app root:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
</IfModule>
Hope this helps!
Upvotes: 3