我有一個codigniter網站,不喜歡添加url參數 例如mysite.com/page/value是好的,但 mysite.com/page/value?url=parameters是壞的。如何刪除htaccess中的url參數
Google廣告系列附加url參數進行跟蹤,我想擺脫這些對Codeigniter的調用。 (我知道有幾個方法可以做到這一點的笨,但我想這樣做htaccess的水平)
我的htaccess是:
<IfModule mod_rewrite.c>
RewriteEngine On
# This is different between local host and production server!!!
RewriteBase/
#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
# If we don't have mod_rewrite installed, all 404's
# can be sent to index.php, and everything works as normal.
# Submitted by: ElliotHaughin
ErrorDocument 404 /index.php
</IfModule>
我應該如何改變它,使之忽略的網址參數,但仍接受mysite/a/b/url?
根據您的解決方案,我達到了這個 \t的RewriteCond%{QUERY_STRING}!^ $ \t重寫規則^ [/] $的index.php?// [L]#如果主頁 \t#任何其他頁remove什麼超越? \t RewriteRule ^(。*)[?]?(。*)$ $ 1 – Nir 2009-12-10 19:04:45