简体   繁体   中英

500 internal server error comes up when i use .htaccess file in wamp server

i was trying to rewrite my post url with htaccess file when i put it into my project directory with following code in the htaccess file 500 internal error comes up, but when i left it(htaccess) blank without any code the page loads perfectly.

RewriteEngine on
RewriteRule ^post post.php

Error is:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at admin@example.com to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

what might be the issue, is there any permission need to be granted or any directives need to be on in config file or php.ini i am new in php development. plz help. Thank you

It must be

RewriteEngine on
RewriteRule ^post$ post.php

try:

<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteRule ^post post.php [L,R=301]
</IfModule>

With this code the error should disappear but it's possible that your rule is not applying correctly, in this case we will fix

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM