1. Installation
Copy codeThe Code is as follows:
./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
Copy codeThe Code is as follows:
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.