我想重定向以下網址:使用mod_rewrite
和.htaccess
htaccess的重定向到另一個網址
我該怎麼辦
http://abc.com/colleges/first.php
到
http://abc.com/first.php
這個?
我想重定向以下網址:使用mod_rewrite
和.htaccess
htaccess的重定向到另一個網址
我該怎麼辦
http://abc.com/colleges/first.php
到
http://abc.com/first.php
這個?
嘗試在你的.htaccess驗證碼:
Options -MultiViews +FollowSymLinks
RewriteEngine On
RewriteRule ^[^/]+/(.*)$ /$1 [L]
使用301重定向 例如:重定向301 /old/old.htm http://www.you.com/new.htm
如果它只是first.php
頁面,則:
RewriteEngine on
RewriteBase/
RewriteRule ^colleges/first.php$ /first.php
如果是需要重定向到根的/colleges
文件夾中的每個頁面:
RewriteEngine on
RewriteBase/
RewriteRule ^colleges/(.*)$ /$1
搜索[.htaccess重定向](http://stackoverflow.com/search?q=.htaccess+redirect) – 2011-06-09 12:44:40
請在投票前閱讀:http://meta.stackexchange.com/questions/39063關閉。 – Kev 2011-06-13 12:25:15