Home > Backend Development > PHP Tutorial > Record the sub-domain name and static link just made with mod_rewrite codeigniter_PHP tutorial

Record the sub-domain name and static link just made with mod_rewrite codeigniter_PHP tutorial

WBOY
Release: 2016-07-13 10:51:58
Original
1104 people have browsed it




Record the sub-domain name and static link just made with mod_rewrite codeigniter
Solution
1. Take a look at your apache2/bin/httpd l
Is there mod_rewrite.so
in it? If not, please recompile withrewrite
2. Add load module to httpd.conf (check the syntax yourself)
If something appears in build when restarting apache, it means that the module has been compiled into apache and does not need to be loaded. Remove the line httpd.conf
3. Open your conf/extra/httpdvhosts.conf
Find your virtual host, this is my configuration file
I need to separate 7 channels. Note that the host header regex cannot match .+?, which will kill your img.domain.com, so be careful

ServerAdmin [url=http://www.phpchina.com/bbs/mailto:www@domain.com]Link tag www@domain.com[/url]
DocumentRoot "/data0/wwwroot/www2.domain.com/"
ServerName [url=http://www.domian.com/]Link tag www.domian.com[/url]
ServerAlias ​​game.domain.com soft.domain.com video.domain.com theme.domain.com ebook.domain.com pic.domain.com audio.domain
i.com domain.com
ErrorLog "|/usr/local/sbin/cronolog /data1/logs/httpd/www2/error_log.%Y%m%d"
CustomLog "|/usr/local/sbin/cronolog /data1/logs/httpd/www2/access_log.%y%m%d" combined
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(game|soft|video|theme|pic|audio|ebook).domain.com$
RewriteRule ^(.+) %{HTTP_HOST}$1 [C]
RewriteRule ^(game|soft|video|theme|pic|audio|ebook).domain.com(/*)$ /index.php/$1
RewriteRule ^(game|soft|video|theme|pic|audio|ebook).domain.com/(lists|detail)/(.*?).html$ /index.php/$1/$2/$3


The above configuration can help me disguise the [url=http://www.domain.com/index.php/game] link mark http://www.domain.com/index.php/game[/url] as [ url=http://game.domain.com/]Link tag http://game.domain.com[/url]
[url=http://game.domain.com/lists/2/40.html]Link tag http://game.domain.com/lists/2/40.html[/url] => [url=http ://www.domain.com/index.php/game/lists/2/40]Link tag http://www.domain.com/index.php/game/lists/2/40[/url]
Note apache2/bin/apachectl restart

[ ]


D8888D’s reply content
The key is regular url matching. [img]http://www.phpchina.com/bbs/images/smilies/default/biggrin.gif[/img]
D8888D’s reply content
I think you might as well create a second-level domain name to point to.
If it were applied to one link per member, the experiment would be understandable. I think this will increase a lot of load on apache

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/632531.htmlTechArticleRecord the sub-domain name and static link codeigniter just made with mod_rewrite Solution 1. Look at your apache2/ Is there mod_rewrite.so in bin/httpd l? If not, please recompile...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template