Initially contact with Phalcon and follow the official documentation to write code. The file structure is consistent with the official code {code ...} added in the root directory and public directory respectively. the htaccess File Code is as follows: {code ...} {code ...} enter localhosttutorial in the address bar of the browser according to the official document... first contact with Phalcon and follow the official documentation to write code
File structure is consistent with official
tutorial/ app/ controllers/ models/ views/ public/ css/ img/ js/
The. htaccess file is added to the root directory and the public directory respectively.
The Code is as follows:
./htaccess
RewriteEngine on RewriteRule ^$ public/ [L] RewriteRule (.*) public/$1 [L]
./public/.htaccessAddDefaultCharset UTF-8
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?_url=/$1 [QSA,L]
Enter localhost/tutorial/in the address bar of your browser to access the public/index. php file.
However, if I enter localhost/tutorial, a message is displayed.
ForbiddenYou don't have permission to access /tutorial/ on this server.
You can directly enter localhost/tutorial/public/index. php for normal access or display this content.
My apache version is 2.4.10, And the configuration file has been changed
DocumentRoot "/Users/anneason/www/"
Options FollowSymLinks MultiviewsMultiviewsMatch AnyAllowOverride AllOrder deny,allowAllow from all
After modifying the access permission, the system still cannot access the database and prompts "no permission ".
How can I solve this problem? I have been troubled for a long time. Please help me. Thank you :)
Reply content:
First contact with Phalcon and follow the official documentation to write code
File structure is consistent with official
tutorial/ app/ controllers/ models/ views/ public/ css/ img/ js/
The. htaccess file is added to the root directory and the public directory respectively.
The Code is as follows:
./htaccess
RewriteEngine on RewriteRule ^$ public/ [L] RewriteRule (.*) public/$1 [L]
./public/.htaccessAddDefaultCharset UTF-8
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?_url=/$1 [QSA,L]
Enter localhost/tutorial/in the address bar of your browser to access the public/index. php file.
However, if I enter localhost/tutorial, a message is displayed.
ForbiddenYou don't have permission to access /tutorial/ on this server.
You can directly enter localhost/tutorial/public/index. php for normal access or display this content.
My apache version is 2.4.10, And the configuration file has been changed
DocumentRoot "/Users/anneason/www/"
Options FollowSymLinks MultiviewsMultiviewsMatch AnyAllowOverride AllOrder deny,allowAllow from all
After modifying the access permission, the system still cannot access the database and prompts "no permission ".
How can I solve this problem? I have been troubled for a long time. Please help me. Thank you :)
OSX
Check whether mod_rewrite is enabled for phpinfo () by yourself.
It is found that the function is not enabled.
Enable and restart.
Thank you O (∩ _ ∩) O
I guess your apache version is 2.0;
If it is Apache 2.0 Handler; for example, Mac comes with this version;
Find httpd. conf under Apache and add the following section:
# use .htaccess files for overriding,AccessFileName .htaccess# and never show them
Order allow,deny Deny from all