ArticleDirectory
- 1. htaccess file (do not restart Apache)
- 2. Apache conf (restart Apache)
Note:
Web server: Apache httpd is used as an example.
Program: Taking php as an Example
Solution 1: the easiest way to configure Apache
Uri effect: 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: configure two methods for 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 /.
The same is true for mediawiki, which was researched a few days ago. After a try, I suddenly realized that solution 1 still exists.
Two years later, recorded here.