I’ve installed cakePHP on Windows7+Apache2.2 and tried blog tutorial.
Now I’ve been confusing redirection control with .htaccess.
I’ve followed instruction of tutorial for setting .htaccess.
htdocs
.htaccess
app
.htaccess
webroot
.htaccess
Eache .htaccess files are below.
[under htdocs]
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
</IfModule>
[under app]
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
</IfModule>
[under wabroot]
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
But error happens,here is message in error.log
client denied by server configuration: :/Apache2.2/htdocs/app/webroot/.htaccess
What’s wrong ?
This tutorial app uses following URLs.
http://mydomain/posts/index // show index page
http://mydomain/posts/view/3 //show an article selected from index(3 means ID number)
http://mydomain/posts/add //show a page for posting new articl
http://mydomain/posts/edit/3 //show a page for e
http://mydomain/posts/delete/3 //delete an article selected from index
.htaccess
control redirection normally when URLs are /index and /view/3.
But if URLs are /add
,/edit/3
and /delete
apache doesn’t redirect them to index.php
.
Actually operation for articles with add
,edit
and delete
are processed successfully.
And add
,edit
and delete
use POST
method
I guess if its method is POST redirection will be failure.
Your folder structure is not seems good... You have to create a project name under htdocs and copy Cakephp files to that folder. Like-
htdocs
--myapplication
.htaccess
-- app
.htaccess
-- webroot
.htaccess
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With