我想使用 mod-rewrite 来转换:
https://newbootstrap.com/quiz
到:
https://newbootstrap.com/index.php?url=quiz
这是我的 .htaccess:
Options +FollowSymlinks
Options -Indexes
AddType text/x-component .htc
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>
RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
<IfModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text\.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image\.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</IfModule>
<FilesMatch ".(flv|gif|jpg|jpeg|png|ico|swf|js|css|pdf)$">
Header set Cache-Control "max-age=2592000"
</FilesMatch>
#Запрет перехода с определенного сайта
#<IfModule mod_rewrite.c>
#RewriteEngine on
#RewriteCond %{HTTP_REFERER} bannedurl1.com [NC,OR]
#RewriteCond %{HTTP_REFERER} bannedurl2.com [NC,OR]
#RewriteRule .* - [F]
#</ifModule>