htaccess 通配符子域,而不考虑设置子域


htaccess wildcard subdomain regardless of set-up subdomains

绑定DNS设置:

*.se7en.net.pl   A  Default 12.34.56.789

Apache 虚拟主机:

DocumentRoot /var/www/wild
ServerAlias *.se7en.net.pl
<Directory "/var/www/wild">
    allow from all
    Options None
    Require all granted
</Directory>

这适用于在我键入任何子域时重定向到/var/www/wild目录。
但是,当我在/var/www/wild中创建.htaccess文件时,它得到:

RewriteEngine on
RewriteCond %{HTTP_HOST} !^se7en'.net'.pl [NC]
RewriteCond %{HTTP_HOST} ^([^'.]+)'.([^'.]+)'.([^'.]+)$
RewriteRule ^(.*)$ http://se7en.net.pl/hta.php?id=$1 [L,R=301,NC]

收到错误 403 禁止访问...

我想达到这种效果:
如果我去tits.se7en.net.pl我希望这个页面被称为:http://se7en.net.pl/hta.php?id=tits,但我不知道该怎么做;(

一旦我使用了这段代码,它就开始工作了:
RewriteEngine on RewriteCond %{HTTP_HOST} ^(.+?)'.se7en'.net'.pl$ RewriteRule .* http://test.se7en.net.pl/hta.php?id=%1 [L]

但是,每当我进入tits.se7en.net.pl地址栏都会更改为 http://test.se7en.net.pl/hta.php?id=tits ,这是我想隐藏的东西。
这有可能隐藏吗?

如果域以其他任何内容开头,则domain.com重定向。

RewriteEngine on
RewriteCond %{HTTP_HOST} !^domain'.com [NC]
RewriteCond %{HTTP_HOST} ^([^'.]+)'.([^'.]+)'.([^'.]+)$
RewriteRule ^(.*)$ http://domain.com/%1/index.php?page=$1 [L,R=301,NC]