1
<Directory /var/www/website/html>
Options +SymLinksIfOwnerMatch -Indexes
AllowOverride All
RewriteEngine on
# Enforce removal of trailing slash
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
# If the user is performing a search
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{QUERY_STRING} ^query=([^&]+)
RewriteRule ^(.*)$ index.php?uri=$1&query=%1 [L,B]
# If the user has a token set
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{QUERY_STRING} ^token=([^&]+)
RewriteRule ^(.*)$ index.php?uri=$1&token=%1 [L,B]
# If not existing file/directory, redirect to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?uri=$1 [L,B]
</Directory>
當我張貼上面的QUERY_STRING
條件服務器上的數據到一個目錄,看來該RewriteRule
被清除後的數據。重寫規則結算後的數據
我期待修改此RewriteRule
,以便在滿足這些條件時仍可訪問發佈數據。
這個.htaccess中有更多的規則嗎? – anubhava
@anubhava在'apache2.conf'中更新了完整的目錄列表,我所指的規則是用「如果用戶有令牌集」註釋的規則 – jskidd3
您的發佈請求URL是否有尾部斜線? – anubhava