Keep a record of the domain names and static links that you just made with mod_rewrite codeigniter_php tutorial

Source: Internet
Author: User
Tags codeigniter domian
Make a note of the domain name and static link that you just made with mod_rewrite CodeIgniter
Workaround
1. Look at your apache2/bin/httpd l
Is there mod_rewrite.so in there?
If not, recompile withrewrite
2.httpd.conf Add load module (grammar self-check)
When you restart Apache, when in build, it means that the module has been compiled into Apache, it does not need to be loaded, remove the line just now httpd.conf
3. Open your conf/extra/httpdvhosts.conf
Find your virtual host, this is my profile
I need to divide 7 channels, note that the host header is not. +? Match, this will kill your img.domain.com, so be cautious.

ServerAdmin [url=http://www.phpchina.com/bbs/mailto:www@domain.com] link marker Www@domain.com[/url]
DocumentRoot "/data0/wwwroot/www2.domain.com/"
ServerName [url=http://www.domian.com/] link marker 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 to [url=http://www.domain.com/index.php/game] link tag Http://www.domain.com/index.php/game[/url] disguised as [url=http ://game.domain.com/] link marker Http://game.domain.com[/url]
[url=http://game.domain.com/lists/2/40.html] link mark http://game.domain.com/lists/2/40.html[/url] = [url=http:// WWW.DOMAIN.COM/INDEX.PHP/GAME/LISTS/2/40] link marker Http://www.domain.com/index.php/game/lists/2/40[/url]
Note Apache2/bin/apachectl restart

[ ]


d8888d Huitie Content
The key is URL regular matching. [Img]http://www.phpchina.com/bbs/images/smilies/default/biggrin.gif[/img]
d8888d Huitie Content
I think that you might as well build a two-level domain point.
If it is applied to a member each link, so the experiment is understandable. I think it's a lot more load on Apache.

http://www.bkjia.com/PHPjc/632531.html www.bkjia.com true http://www.bkjia.com/PHPjc/632531.html techarticle make a note of the domain name you just used mod_rewrite and the static link CodeIgniter workaround 1. See if there is any mod_rewrite.so in your apache2/bin/httpd L. Re-compile ...

  • 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.