目前這是在我的 .htaccess 檔案中
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /dev/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /dev/index.php [L]
</IfModule>
但是,當用戶輸入此 url 時,http://test-site.com 應該重定向到http://test-site.com/dev/
在這方面有人可以幫助我嗎?
uj5u.com熱心網友回復:
使用您顯示的示例,嘗試,請嘗試遵循 htaccess 規則檔案。請確保在測驗您的 URL 之前清除您的瀏覽器快取。我還在新規則之前和現有規則的小修復之前發表了評論。
<IfModule mod_rewrite.c>
RewriteEngine On
##adding new rule for redirection here...
RewriteRule ^/?$ /dev? [R=301,L]
RewriteBase /dev/
##Added NC flag here for ignore case.
RewriteRule ^index\.php$ - [NC,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /dev/index.php [L]
</IfModule>
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/465399.html
