Currently apache pseudo static URL rewrite. htaccess is the following rule:
http://www.abc.com---> index.php
http://www.abc.com/late/--->./filedir/late.php?p=1
http://www.abc.com/popular/--->./filedir/popular.php?p=1
Http://www.abc.com/down/name-id/--->./filedir/detail.php?id=number
Http://www.abc.com/cat/catname-catid/--->./filedir/cat.php?catid=number
Http://www.abc.com/bb--->./filedir/bb.php
http://www.abc.com/bblate/--->./filedir/bblate.php?p=1
http://www.abc.com/bbpopular/--->./filedir/bbpopular.php?p=1
Http://www.abc.com/bdown/name-id/--->./filedir/bbdetail.php?id=number
Http://www.abc.com/bcat/bcatname-catid/--->./filedir/bbcat.php?bbcat.php?catid=number
Now to add a level two domain name bb.abc.com also point to the www.abc.com server, and the domain name after the path to the same as the www.abc.com form, namely
http://bb.abc.com--->./filedir/bb.php
http://bb.abc.com/late/--->./filedir/bblate.php?p=1
http://bb.abc.com/popular/--->./filedir/bbpopular.php?p=1
Http://bb.abc.com/down/name-id/--->./filedir/bbdetail.php?id=number
Http://bb.abc.com/cat/bcatname-catid/--->./filedir/bbcat.php?bbcat.php?catid=number
How do you write this? htaccess URL rewrite rules? Display different content by judging the domain name
Reply content:
Currently apache pseudo static URL rewrite. htaccess is the following rule:
http://www.abc.com---> index.php
http://www.abc.com/late/--->./filedir/late.php?p=1
http://www.abc.com/popular/--->./filedir/popular.php?p=1
Http://www.abc.com/down/name-id/--->./filedir/detail.php?id=number
Http://www.abc.com/cat/catname-catid/--->./filedir/cat.php?catid=number
Http://www.abc.com/bb--->./filedir/bb.php
http://www.abc.com/bblate/--->./filedir/bblate.php?p=1
http://www.abc.com/bbpopular/--->./filedir/bbpopular.php?p=1
Http://www.abc.com/bdown/name-id/--->./filedir/bbdetail.php?id=number
Http://www.abc.com/bcat/bcatname-catid/--->./filedir/bbcat.php?bbcat.php?catid=number
Now to add a level two domain name bb.abc.com also point to the www.abc.com server, and the domain name after the path to the same as the www.abc.com form, namely
http://bb.abc.com--->./filedir/bb.php
http://bb.abc.com/late/--->./filedir/bblate.php?p=1
http://bb.abc.com/popular/--->./filedir/bbpopular.php?p=1
Http://bb.abc.com/down/name-id/--->./filedir/bbdetail.php?id=number
Http://bb.abc.com/cat/bcatname-catid/--->./filedir/bbcat.php?bbcat.php?catid=number
How do you write this? htaccess URL rewrite rules? Display different content by judging the domain name
Find a method:
Rewritecond%{http_host} ^bb.abc.com$
Rewriterule ^ (/)? $./filedir/bb.php [L]
Rewritecond%{http_host} ^bb.abc.com$
Rewriterule ^late/$./filedir/bblate.php?p=1 [L]
Also thank Nathan_wu
Serveralias bb.abc.com