2013-04-17 133 views
2

我以前做過這件事,它就像一行代碼。現在,當我查找它時,只需將5-10行重定向到.htaccess中的index.php到根(/)即可。將index.php重定向到根

這樣做的最好方法是什麼?

+0

http://stackoverflow.com/questions/9369917/htaccess-redirect- index-php-to-root-including-subdomains – djb

回答

4

此代碼對我的作品

RewriteCond %{THE_REQUEST} ^.*/index.php 
RewriteRule ^(.*)index.php$ /$1 [R=301,L] 
+0

謝謝!像魅力一樣工作 – ramo

1

可能它是這樣的,你正在尋找:

Redirect 301 /index.php http://www.yoursite.com/folder/ 
相關問題