Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何重定向到子目录而不使用.htaccess在url中显示它?_.htaccess_Redirect_Url Rewriting_Url Redirection - Fatal编程技术网

如何重定向到子目录而不使用.htaccess在url中显示它?

如何重定向到子目录而不使用.htaccess在url中显示它?,.htaccess,redirect,url-rewriting,url-redirection,.htaccess,Redirect,Url Rewriting,Url Redirection,我有一个目录/store我想将www.example.com重定向到www.example.com/store。。不显示url中的/store 另外,当我单击/store中的任何产品时,如/store/product1.html,我需要转到www.example.com/store/product1.html,而不在url中显示/store 我尝试了这个,它重定向到/store,但它仍然在url上: RewriteEngine on RewriteCond %{REQUEST_URI} !^st

我有一个目录
/store
我想将
www.example.com
重定向到
www.example.com/store
。。不显示url中的
/store

另外,当我单击
/store
中的任何产品时,如
/store/product1.html
,我需要转到
www.example.com/store/product1.html
,而不在url中显示
/store

我尝试了这个,它重定向到/store,但它仍然在url上:

RewriteEngine on
RewriteCond %{REQUEST_URI} !^store/
RewriteRule ^(.*)$ store/$1 [L]
RewriteEngine on
RewriteBase /
RewriteRule !^store/ /store%{REQUEST_URI}