开发者

HTA redirect - mask URL

开发者 https://www.devze.com 2023-04-12 22:06 出处:网络
I\'m having trouble redirecting my main website www.mydomain.com to the folder mydomain.com/stuff/public_html/index.html while retaining www.mydomain.com in the URL. I\'dprefer to use HTA over some ht

I'm having trouble redirecting my main website www.mydomain.com to the folder mydomain.com/stuff/public_html/index.html while retaining www.mydomain.com in the URL. I'd prefer to use HTA over some html solution, but what'开发者_StackOverflow中文版s the most SE friendly and modern solution for this?

I've tried the simple HTA 301 redirect below, but it shows the file path which I want to avoid.

RewriteEngine on

RewriteCond %{HTTP_HOST} ^mydomain\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.mydomain\.com$
RewriteRule ^/?$ "http\:\/\/www\.mydomain\.com\/stuff\/public_html\/" [R=301,L]

Thanks!


Looks like you do not need an external redirect. You need an internal redirect. For this you need to remove the [R] flag in your rule (and have only [L]). The [R] flag forces an external redirect with a HTTP 301 response code.

0

精彩评论

暂无评论...
验证码 换一张
取 消