如何重定向到子目录而不使用.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}