在 url 中添加共享文件系统的内容


Htaccess adding contents of shared file system in url

我已经建立了一个完全免费的网站,带有x10hosting和freenom(.ml)。在这个网站上,我有一个account子域,它使用public_html目录中/account/目录的内容。

一切正常,但是当http://account.lynk.ml/login被重写时,它会重写为http://www.account.lynk.ml/home/MYUSERNAME/public_html/account/login.php

有没有办法让它有网址http://account.lynk.ml/login?提前谢谢。

htaccess 中的子域代码:

# Account subdomain
RewriteCond %{HTTP_HOST} ^account'.lynk'.ml$
RewriteCond %{REQUEST_URI} !^/account/
RewriteRule (.*) /account/$1

我是子域的新手,所以不要指望我有太多的知识。 ;)

您可能

正在寻找以下内容;它基本上会重写从subdomain.example.comsubdomain.example.com/account/login的任何内容:

RewriteEngine On
RedirectMatch ^/$ /login
RewriteRule ^login account/$1
RewriteCond %{THE_REQUEST} ^GET' /account/
RewriteRule ^account/(.*) /login/$1 [L,R=301]

这会将内容保留在/account中,并使 URL 显示为/login