我想使用我的.htaccess文件,但我仍然无法弄清楚我做错了什么。错误使用.htaccess
我的.htaccess是文件夹“porcelanato”里面,它有这样的代码:
RewriteEngine on
RewriteBase /porcelanato/
我只想让我的index.php变成yescpol.com.br
我在做什么错?
我想使用我的.htaccess文件,但我仍然无法弄清楚我做错了什么。错误使用.htaccess
我的.htaccess是文件夹“porcelanato”里面,它有这样的代码:
RewriteEngine on
RewriteBase /porcelanato/
我只想让我的index.php变成yescpol.com.br
我在做什么错?
最简单的做法是更改域配置中的DocumentRoot或将文件移出该文件夹并移入根目录。
如果你想坚持使用重写方法,你需要添加一个这样的规则。
RewriteEngine On
RewriteRule ^$ /porcelanato [L]
此行添加到您的.htaccess文件的顶部: DirectoryIndex index.php
但如果这个属性是正确设置你的apache服务在httpd.conf(或无论是您的服务页),这将不会有被添加到你的.htaccess文件。
你可以访问你的Apache配置,这似乎更喜欢用'DocumentRoot'问题设置[见文档(https://httpd.apache.org/docs/2.4/mod/core。 html#documentroot) – Theo