使用 .htaccess 隐藏文件 URL


using .htaccess to hide file url

我需要一些帮助来弄清楚如何编写此.htaccess

我的文件在mywebsite/part5/thanksfordownload.html.如何使用.htaccessmywebsite/thankyoufordownload.html网址?

我尝试将其用于.htaccess但没有骰子。我尝试在根目录和文件夹本身中上传它。

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /part5/$1 [L]

不知道这部分出了什么问题,提前感谢您的意见和评论!

好吧,

基本上如果你想要这个规则 - 你会想做这样的事情 -

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^thankyoufordownload.html$ /part5/thankyoufordownload.html [L]

简单地说:

RewriteRule ^thankyoufordownload.html$ part5/thanksfordownload.html

这仅适用于所询问的示例。