How to write two level domain name jump two level directory pseudo-Static or PHP

Source: Internet
Author: User
How to write a two level domain name jump level two directory pseudo-Static or PHP
Current purpose-achieved code

Rewriteengine on

Rewritecond%{http_host} ^sell-meihualu.abc.com$ [NC]
Rewriterule (. *) http://www\.abc\.com/sell/meihualu/$1 [r=301,nc,l]



How to set sell to variable a
Meihualu set to Variable b
Realize
A-b.abc.com
Jump to the corresponding
www.abc.com/A/B/


Or there's no big God. php files can be resolved
I just learned not long

------to solve the idea----------------------
That's 301 jump, not pseudo-static.
The URL changes after the jump.

That's what I'm using.
Rewritecond%{http_host} ^ ([^\.] +). tool.net$
Rewriterule ^ (/?) (. *) $/users/%1/$2 [pt,l]
The URL of the blog.tool.net/index.php is positioned to users/blog/index.php
The URL does not change

In the same vein, your rules are written so you can do it.
Rewritecond%{http_host} ^ ([a-z]+)-([a-z]+). abc.com$ [NC]
Rewriterule (. *) http://www\.abc\.com/%1/%2/$1 [r=301,nc,l]

Not only sell-meihualu.abc.com such a level two domain name, right?
  • 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.