htaccess文件不起作用,可以在子文件夹中访问php文件
我正在使用HTACCESS文件在我的网站项目中具有子域的较短链接。它在以前的环境中正常工作,但是现在在新的PC上(Fresh Xampp和Laragon安装),它无法按预期工作。 我希望能够访问http:// localhost/poradnik/smart
(poradnik \ pages \ smart.php) 但是我遇到了404个错误,无法打开子网站。
我的.htaccess文件看起来像这样:
RewriteCond %{HTTPS} of
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-zA-Z-_0-9]+)/?$ index.php?page=$1 [L]
RewriteRule ^([a-zA-Z-_0-9]+)/([a-zA-Z-_0-9]+)?$ index.php?page=$1/$2 [L]
SetEnv BASEURL "https://localhost/poradnik/"
我的文件分支如下: 文件列表
Im using htaccess file to have shorter links for subdomains in my website project. It was working in previous envinorment just fine, but now on new PC (fresh xampp and laragon install), it's not working as intended.
I want to be able to access http://localhost/poradnik/smart
(poradnik\pages\smart.php)
but i get a 404 error and the subwebsite cant be opened.
my .htaccess file looks like this:
RewriteCond %{HTTPS} of
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-zA-Z-_0-9]+)/?$ index.php?page=$1 [L]
RewriteRule ^([a-zA-Z-_0-9]+)/([a-zA-Z-_0-9]+)?$ index.php?page=$1/$2 [L]
SetEnv BASEURL "https://localhost/poradnik/"
And my file branch is as follows:
file list
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论