基本上我不希望访问我网站的人获取所有文件,但是我在互联网上尝试和发现的所有东西都不允许在 index.php 之后使用 GET 变量。我正在使用重写使 domain.com/lol 转到 index.php?lol。
这是我当前的 .htaccess 文件,如果您想修改它以使我更容易,也请继续。
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.domain\.com [NC]
RewriteRule .? http://domain.com%{REQUEST_URI} [L,R=301]
RewriteRule ^act/(.*)$ index.php?act=$1
RewriteRule ^code/(.*)$ index.php?code=$1
RewriteRule ^login$ index.php?login
RewriteRule ^logout$ index.php?logout
RewriteRule ^add$ index.php?add
RewriteRule ^tac$ index.php?tac
RewriteRule ^profile$ index.php?profile