Apache 子域和文件夹的重写规则
我需要为Apache编写重写规则,以便与子域一起使用。这些规则应基于:Apache 子域和文件夹的重写规则,apache,mod-rewrite,subdomain,Apache,Mod Rewrite,Subdomain,我需要为Apache编写重写规则,以便与子域一起使用。这些规则应基于: subdomain.domain.com => /home/domain/docs/some_folder/file.php?subdomain=subdomain subdomain.domain.com/edit => /home/domain/docs/some_other_folder/file.php subdomain.domain.com/dashboard/display/id => /ho
subdomain.domain.com => /home/domain/docs/some_folder/file.php?subdomain=subdomain
subdomain.domain.com/edit => /home/domain/docs/some_other_folder/file.php
subdomain.domain.com/dashboard/display/id => /home/domain/docs/some_other_folder2/file.php?param1=display¶m2=id
我还在网站上使用AJAX调用,这并不容易,因为我从搜索互联网中了解到了这一点。因此,这方面的一些提示也确实会有帮助
我真的很感谢你的帮助!
提前谢谢。我要试试这个
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} !^subdomain.domain.com$
RewriteRule .* - [L]
RewriteCond %{HTTP_HOST} (.*)
RewriteRule ^$ /home/docs/some_folder/file.php?subdomain=%1 [L,QSA]
RewriteRule ^edit$ /home/docs/some_other_folder/file.php [L]
RewriteRule ^dashboard/(\w+)/(\w+) /home/docs/some_other_folder2/file.php?param1=$1¶m2=$2 [QSA,L]