【问题标题】:403 You don't have permission to access this folder after removing hashbang on AngularJS403 删除 AngularJS 上的 hashbang 后,您无权访问此文件夹
【发布时间】:2015-10-25 17:41:38
【问题描述】:

我试图从 angularjs 应用程序的 URL 中删除 hashbang,我通过 htaccess 找到了解决方案:

RewriteEngine On 
Options FollowSymLinks

RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ /#/$1 [L]

它在 locathost XAMPP 上运行良好,但是当我将它上传到我的网络服务器 cPanel 时,它无法直接访问任何 PHP 文件或文件夹,它显示错误:403 禁止的 您无权访问此服务器上的 /anotherFolder/index.php。

如果我删除此 htaccess,我可以访问该文件

请帮忙 谢谢

【问题讨论】:

  • 设置文件权限为 777 并尝试再次连接。
  • 在 777 之后它不起作用:(
  • 如果我删除这个 htaccess,我可以访问该文件
  • 很遗憾,我无法为您提供帮助;/.
  • 你能在你的 .htaccess 中检查条件,像这样 重写规则

标签: php angularjs .htaccess


【解决方案1】:

我最终通过替换:

RewriteEngine On 
Options FollowSymLinks

RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ /#/$1 [L]

与:

RewriteEngine On 
Options +FollowSymLinks

RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ /#/$1 [L]

【讨论】:

    猜你喜欢
    • 2023-03-08
    • 2021-12-27
    • 2017-09-15
    • 2017-06-22
    • 1970-01-01
    • 2020-05-07
    • 2017-07-06
    • 2019-02-16
    • 1970-01-01
    相关资源
    最近更新 更多