1
我想使基於codeigniter的網站能夠將index.php?option = test & controller = con1轉換爲/ test/con1使用.htaccess我試着找到多個示例似乎沒有工作,它直接進入主頁。有任何想法嗎?apache htaccess codeigniter查詢字符串路徑
我已經嘗試過類似的事情
RewriteCond %{QUERY_STRING} ^(\w+)=(\w+)$
RewriteRule ^\/(.+?)\/(.+?)\/? /index.php/$1/$2 [L]
,但不會引發任何錯誤或任何東西。 我目前htacces是
RewriteEngine on
RewriteCond $1 !^(index\.php|images|css|img|js|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
移動的RewriteCond的一個不同點? – Shawn
只是試圖用我上面提供的 –
替換你當前的htaccess。我確實沒有看到任何區別,仍然忽略了GET參數。 – Shawn