admin管理员组文章数量:1127898
-This problem does not happen on the deployed Heroku application but only on the local domain. -index.php and .htaccess are stored in (root)/public
My issue is that XAMPP doesn't seem to read .htaccess and when I try to access domain.local it doesn't redirect to index.php and it fully exposes the folders and files of the application.
When I try to access the domain, arcadia-2025-lastrun.local, I find a list of folders and all the files present in the application, instead of being redirected to index.php. I want to emphasize that index.php and .htaccess are located in (root)/public/
I made the local domain beforehand and the VirtualHost is as follows:
<VirtualHost *:80>
DocumentRoot "C:\xampp\htdocs\ARCADIA-2025-LASTRUN"
ServerName ARCADIA-2025-LASTRUN.local
</VirtualHost>
I have this as .htaccess — it causes no issue when deployed to Heroku:
RewriteEngine On
#accept loading of actual files and directories
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#send everything else to the index page
RewriteRule ^(.*)$ index.php?url=$1 [L,QSA]
-This problem does not happen on the deployed Heroku application but only on the local domain. -index.php and .htaccess are stored in (root)/public
My issue is that XAMPP doesn't seem to read .htaccess and when I try to access domain.local it doesn't redirect to index.php and it fully exposes the folders and files of the application.
When I try to access the domain, arcadia-2025-lastrun.local, I find a list of folders and all the files present in the application, instead of being redirected to index.php. I want to emphasize that index.php and .htaccess are located in (root)/public/
I made the local domain beforehand and the VirtualHost is as follows:
<VirtualHost *:80>
DocumentRoot "C:\xampp\htdocs\ARCADIA-2025-LASTRUN"
ServerName ARCADIA-2025-LASTRUN.local
</VirtualHost>
I have this as .htaccess — it causes no issue when deployed to Heroku:
RewriteEngine On
#accept loading of actual files and directories
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#send everything else to the index page
RewriteRule ^(.*)$ index.php?url=$1 [L,QSA]
Share
Improve this question
asked Jan 8 at 15:52
IcyAukIcyAuk
1
1 Answer
Reset to default 0Problem solved.
XAMPP does not automatically look for /public like Heroku seems to do.
Add your /public folder in httpd-vhosts.conf
<VirtualHost *:80>
DocumentRoot "C:\xampp\htdocs\ARCADIA-2025-LASTRUN/public"
ServerName ARCADIA-2025-LASTRUN.local
<Directory "C:/xampp/htdocs/ARCADIA-2025-LASTRUN/public">
Options -Indexes
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
本文标签:
版权声明:本文标题:XAMPP refuses to redirect to index.php and ignores .htaccess. The local domain shows raw folders and files in the application - 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736707126a1948738.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论