仅具有.htaccess的子域

仅具有.htaccess的子域,.htaccess,subdomain,.htaccess,Subdomain,我得到了网址链接 是否可以使用htaccess创建一个类似toscana.mysite.it的url 谢谢你的回答 这是我的htaccess: <IfModule mod_rewrite.c> Options +FollowSymLinks -MultiViews RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^mysite\.it$ [NC] RewriteCond %{QUERY_STRING} (^|&a

我得到了网址链接

是否可以使用htaccess创建一个类似toscana.mysite.it的url 谢谢你的回答

这是我的htaccess:

<IfModule mod_rewrite.c> 
Options +FollowSymLinks -MultiViews
RewriteEngine On 
RewriteBase /

RewriteCond %{HTTP_HOST} ^mysite\.it$ [NC] 
RewriteCond %{QUERY_STRING} (^|&)sRegion=([^&]*) [NC] 
RewriteRule ^index\.php$ http://%2.%{HTTP_HOST}%{REQUEST_URI} [R=301,NC,L]

RewriteRule ^index\.php$ - [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

选项+以下符号链接-多视图
重新启动发动机
重写基/
RewriteCond%{HTTP_HOST}^mysite\.it$[NC]
RewriteCond%{QUERY_STRING}(^ |&)sRegion=([^&]*)[NC]
重写规则^index\.php$http://%2.%{http_HOST}%{REQUEST_URI}[R=301,NC,L]
重写规则^index\.php$-[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则/index.php[L]

通过
httpd.conf
启用
mod_rewrite
.htaccess
,然后将此代码放在
文档根目录下.htaccess
文件中:

Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} ^mysite\.it$ [NC]
RewriteCond %{QUERY_STRING} (^|&)sRegion=([^&]+) [NC]
RewriteRule ^index\.php$ http://%2.%{HTTP_HOST}%{REQUEST_URI} [R=302,NC,L]

可能是重复的啊抱歉我的回答有错。修复了它,现在就尝试编辑代码。我尝试过了,但我被重定向到mysite.it,所以dns还可以,但查询没有执行,缺少什么?感谢anubhava的回答,重写工作,我得到了sRegion.mysite.it/index.php?page=search&sRegion=Toscana,但我得到了这个错误“网页有一个重定向循环”和空白页面。My htaccess:Options+FollowSymLinks-MultiViews RewriteEngine On RewriteBase/RewriteCond%{HTTP_HOST}^ohpla\.it$[NC]RewriteCond%{QUERY_STRING}(^ 124;和)sRegion=([^&]*)[NC]RewriteRule^ index\.php$HTTP:/%2.%{HTTP_HOST}%{REQUEST URI}[R=301,NC,L]RewriteRule^ index\.php$-[L]RewriteCond%{REQUEST FILENAME}-f RewriteCond%{REQUEST_FILENAME}-重写规则/我希望你能帮助我,我真的需要,我正在从各个方面绞尽脑汁。我无法从评论中阅读你的代码,请通过编辑你的问题来发布这段代码。