我希望通过.htaccess文件中的重定向规则隐藏URL。 假设我的网址是192.168.1.2/abc/xyz/index.html
我想只显示192.168.1.2/abc
答案 0 :(得分:0)
# if you have mod rewrite installed in your hosting space, you can enable pretty url for
# compressed css/js by uncommenting following lines
#RewriteEngine On
#Options FollowSymLinks
#RewriteRule ^packs/(\w+)\.(css|js) packs/jscsscomp.php?q=$1.$2
Options +FollowSymlinks
Options -Indexes
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php [L,QSA]
#AuthUserFile /var/www/example.com/public_html/.htpasswd
#AuthType Basic
#AuthName "Login Details Required"
#require user yourname
<Files .htaccess>
order allow,deny
deny from all
</Files>