我的主目录中有一个index.php文件,并且希望其他子目录也使用该文件。因此,当用户调用example.com/subdirectory-1/和example.com/subdirectory-2/时,他应该看到我的主目录的index.php文件的内容。
用htaccess文件可以做到这一点吗?
发布于 2016-11-19 03:49:17
在文档根目录中的htaccess中,添加以下内容:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ /index.php [L]这将重写所有存在的子目录到/index.php。
https://stackoverflow.com/questions/40687380
复制相似问题