我需要在我的网址栏中隐藏文件夹名称。
现在我有了mateotxt.pl/website/regulamin.html
但我需要
mateotxt.pl/regulamin.html
我需要在我的网址栏中跳过这个文件夹名称。
发布于 2021-04-14 21:17:50
这可能就是您要查找的内容:
RewriteEngine on
RewriteRule ^/?regulamin\.html$ /website/regulamin.html [END]如果您正在寻找可能对您有所帮助的一般规则:
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/website/
RewriteRule /website%{REQUEST_URI} [END]尽管您需要注意不实际重写资源,但您不希望以这种方式重写资源。因此,也许存储在服务器端文件系统中其他文件夹中的资源...
您应该在实际的http服务器的主机配置中实现这些指令。如果您无法访问它,可以使用分布式配置文件(通常名为".htaccess"),但这会带来性能损失……
发布于 2021-04-14 20:39:57
您可以尝试以下操作:
RewriteEngine on
RewriteCond %{REQUEST_URI} !^website/
RewriteRule ^(.*)$ website/$1 [L]发布于 2021-04-14 20:45:28
尝尝这个
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/string/
RewriteRule ^string/(.*)$ https://www.domain.eu/$1 [L,NC,R=301]https://stackoverflow.com/questions/67091886
复制相似问题