Recently, there was a problem with the Apache Rewrite pseudo-static configuration. Write the following:
Rewriteengine on
Rewriterule ^/t_ (. *)/$/test.php?id=$1
Found to work when saved in the httpd.conf file.
and written in the. htaccess file, it doesn't work. After research found that the random fill in the characters, the server reported 500 errors, and the orientation is not a problem, so it is not access to the problem, the initial guess should be a grammar problem. Later in Baidu "Rewriterule htaccess" when found an article, the article title: "URL Rewriterule in httpd.conf and. htaccess different points" saw:
It is important to note that the two files added to the URL rewrite rules are slightly different. These differences, for unfamiliar people, are likely to be troubled for a long time.
in httpd.conf: (1) the start of the Request URI must begin with a slash, (2) when looking for the cache file, it must be preceded by a slash, (3) when using-F or!-f, it must be preceded by a slash.
in. htaccess, the exact opposite is the case: (1) The Request URI cannot have a slash at the beginning, (2) It cannot be preceded by a slash when searching for the cache file, (3) It cannot be preceded by a slash when using-f or!-f.
Simply put, in httpd.conf, the URL before and after the rewrite needs to be preceded by a slash "/" when using an absolute path, which means that it starts at the root of the Web site and is not required in. htaccess.
Put the/Remove test OK in the. htaccess file.
Resolution of an invalid write Rewriterule in a. htaccess file