如何制作一个htaccess文件,该文件将重定向到子文件夹索引页
My Structure
ROOT FOLDER
CHILD FOLDER
htaccess
当http:''localhost'root'
是浏览器时,如何使用htaccess文件使控制流到CHILD/index.php?
我在子文件夹(child''test.php)中有一个test.php
。
当用户尝试使用http:''localhost'root'child'test.php
链接时,我想避免在浏览器中访问php文件。请帮帮我,怎么解决?甚至可以更改文件夹结构。
如果用户尝试转到http:''localhost'root'
,您希望它重定向到http:''localhost'root'child'index.php
?
#Make sure url rewriting is turned on
RewriteEngine on
#if the user attempts to access the index.php file, then redirec them to the test.php file.
Redirect 301 index.php /child/test.php