0
讓說我有一箇舊的URL http://abc.com/x.php?a=xyz&b=jkl我需要重定向所有的請求頁面x.php既可以採用具有查詢字符串或不http://xyz.com/x/302 htaccess的從舊的PHP頁面重定向到新的URL
下面是的.htaccess文件,該文件是存在於http://xyz.com
# Turn on URL rewriting
RewriteEngine On
RewriteBase/
# Protect application and system files from being viewed
RewriteRule ^(application|modules|system) - [F,L]
# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $0 !=server-status
# Rewrite all other URLs to index.php/URL
RewriteRule .* index.php/$0 [PT,L]
我的網址與http://abc.com/test/index.php?a=xyz&b=jkl一樣,我希望將此網址重定向到http://abc.com/test/我正在切換到基於框架的網站從簡單的PHP網站。 –
@SushantPrasad和你想要重定向到什麼? (你爲什麼不剛纔問這個問題?) –
你的代碼正在重定向到指定的URL/x /,但它顯示500內部服務器錯誤 服務器遇到內部錯誤或配置錯誤,無法完成請求。 –