Solution to access pseudo-static pages in apache _ MySQL

Source: Internet
Author: User
Solution to access pseudo-static pages in apache: Apache pseudo-static

BitsCN.com

1. Installation

./Configure -- prefix =/usr/local/apache2 -- enable-so -- enable-rewrite -- enable-ssl

Apache now has a pseudo-static function called built-in pseudo-static.

2. if there is no -- enable-rewrite parameter during installation, then:
In the "LoadModule" area, add "LoadModule rewrite_module modules/mod_rewrite.so" to the last line (an exclusive line is required), and restart the apache server.

3. enable the apache server to support. htaccess
Vim/usr/local/apache2/conf/extra/http-vhosts
Options FollowSymLinks
AllowOverride None
Change
Options FollowSymLinks
AllowOverride All
You can.
However, you must add an htaccess file to the website file. To support the pseudo-static function. (Under the website file directory)
Vim. htaccess


RewriteEngine On
RewriteBase/
# Rewrite rules
RewriteRule ^ index/. htm $ index/. php
RewriteRule ^ jobs/jobs-show-([0-9] +)/. htm $ jobs/jobs-show/. php /? Id = $1
RewriteRule ^ company/company-show-([0-9] +)/. htm $ company/company-show/. php /? Id = $1
RewriteRule ^ resume/resume-show-([0-9] +)/. htm $ resume/resume-show/. php /? Id = $1
RewriteRule ^ news/news-list-([0-9] +)-([0-9] +)/. htm $ news/news-list/. php /? Id = $1 & page = $2
RewriteRule ^ news/news-show-([0-9] +)/. htm $ news/news-show/. php /? Id = $1
RewriteRule ^ explain/explain-show-([0-9] +)/. htm $ explain/explain-show/. php /? Id = $1
RewriteRule ^ notice/notice-list-([0-9] +)-([0-9] +)/. htm $ notice/notice-list/. php /? Id = $1 & page = $2
RewriteRule ^ notice/notice-show-([0-9] +)/. htm $ notice/notice-show/. php /? Id = $1

Pseudo static error:
The main site is easy to use, but the link is not easy to use. A link is a static page. It ends with .html, so I decided that the static page did not take effect, so I just need to add the. htaccess file.

BitsCN.com
Related Article

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.