About PHP pseudo-static problem!
My. Htaccess writes like this:
Rewriteengine on
Rewriterule ([A-za-z]{1,})-([0-9]{1,}). html$index.php?action=$1&id=$2
Program code:
Echo ' Your action is: '. $_get[' action '];
echo "
";
Echo ' Your ID is: '. $_get[' id '];
?>
Now enter in the browser:
Localhost/page-18.html
But the error:
Internal Server Error
The server encountered an internal error or misconfiguration and is unable to complete your request.
Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything yo U might has done so may has caused the error.
How can i solve it?
------Solution--------------------
Rewriterule ([A-za-z]{1,})-([0-9]{1,}). html$index.php?action=$1&id=$2
There should be a space before index.php.
------Solution--------------------
What's the reason?
Rewriterule to have the original URL and go to the URL, you have no space, Apache not clear Ah, had to crazy 500
------Solution--------------------
. htaccess is Apache's function, not modified. conf not work, but now most places are enabled by default
If you are asking if you can implement URL parsing and routing in PHP, print_r your $_server with a few variables that contain
Full URL, you can write your own code analysis and then execute different code
Some open source software has the corresponding implementation, you can refer to
discuss
If you do not modify Apache, can you also implement this feature?
------Solution--------------------
discuss
If you do not modify Apache, can you also implement this feature?
Code Geek Recommended solutions:The server encountered an internal error (), prevented it from fulfilling this request.,http://www.daimami.com/java-we B/317.html
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.