Three apache Rewrite url configuration methods

Source: Internet
Author: User
Tags web hosting mediawiki

Three apache Rewrite url configuration methods

Solution 1: the easiest way to configure Apache
URI effect: php tutorial/subject/4843637/"> http://movie.example.com/index.php/subject/4843637/

Case: MediaWiki

Todo

Solution 2: Configure Apache URL rewrite and redirect to index. php with Parameters
URI effect: http://movie.example.com/subject/4843637/

Case: MediaWiki

Todo

Solution 3: Configure Apache URL rewrite and redirect to index. php without Parameters
URI effect: http://movie.example.com/subject/4843637/

Todo

Document: Two Methods for configuring Apache URL rewrite
1. htaccess file (do not restart Apache)
Applicable to: cases where Apache cannot be restarted, such as virtual hosts

Step: Enable AllowOverride All in Apache conf (virtual hosts are generally enabled ),

Write RewriteRule into the. htaccess file and put it in the web Access Directory.

2. Apache conf (restart Apache)
Applicability: VPS and other cases where Apache can be restarted

Step: Write RewriteRule to the httpd. conf or httpd-vhosts.conf File

PS:

When I remembered that at school, on the Web Hosting, I couldn't restart Apache. I wanted to configure rewrite and I couldn't find many books in the library. Later, I learned about. htaccess on the Internet, but it has not been recorded.

Later, the project was always configured with Apache conf. A few days ago, my colleague asked me: if Apache is not configured, why can I use a slash/TO PASS Parameters like index. php/id/123 /.

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.