Record the domain name and static link codeigniter just created using mod_rewrite.

Source: Internet
Author: User
Tags codeigniter domian




Record the domain name and static link codeigniter just created using mod_rewrite.
Solution
1. Check your apache2/bin/httpd l
Is there mod_rewrite.so?
If not, recompile withrewrite.
2. Add the load module in httpd. conf (check the syntax by yourself)
When you restart apache, if any in build occurs, it indicates that the module has been compiled to apache and does not need to be loaded. Remove the line httpd. conf.
3. Open your conf/extra/httpdvhosts. conf
Find your VM. This is my configuration file.
I need to split the seven channels. Note that the Host header is not regular. +? Match, this will kill your img.domain.com, so be careful.

ServerAdmin [url = Response
DocumentRoot "/data0/wwwroot/www2.domain.com /"
ServerName [url = http://www.domian.com/?chain mark 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 [url = ingress as [url = http://game.domain.com/?chain mark http://game.domain.com#/url]
[Url = response => [url = Response
Note apache2/bin/apachectl restart

[]


D8888D reply content
The key is url RegEx matching. [Img] http://www.phpchina.com/bbs/images/smilies/default/biggrin.gif#/img]
D8888D reply content
I think you should point to a second-level domain name.
If you apply the application to a link for each member, this experiment is understandable. I think apache has increased a lot of load.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.