0
我已閱讀了許多帖子和文檔,但仍無法完成此項工作。可能缺少一些微不足道的東西。無法刪除.htaccess中的查詢字符串重寫
我想www.domain.no/?id=val
改寫到www.domain.no/index.php
在.htaccess
的代碼是
RewriteEngine on
RewriteBase/
# Test that pathname exists, and is NOT a directory.
RewriteCond %{REQUEST_FILENAME} !-d
# Test that the pathname with a .php extension exists, and is a regular file.
RewriteCond %{REQUEST_FILENAME}\.php -f
# Test that a non-empty query string exists
RewriteCond %{QUERY_STRING} .
# Re-write to file with .php extension, without query string
RewriteRule ^(.*)$ $1.php? [L]
有什麼建議?
應該是'的RewriteCond%{QUERY_STRING}^ID = VAL $' – hjpotter92
我的理解是, 「的RewriteCond%{QUERY_STRING}」匹配任何查詢字符串,這是我想要的。我不想限制重寫任何特定的查詢。 – Svea
「www.domain.no/?id = val'的問題:沒有擴展名爲.php的文件... – Croises