简体   繁体   中英

500 Internal Server Error while trying to Rewrite URL in .htaccess

I need your help in creating dynamic URL for SEO gains.. I tried to implement the following .htaccess on my present URL. But I got an 500 Internal Server Error

please where could the problem be? Thanks

Link

http://127.0.0.1/index.php?id=1

.htaccess

RewriteEngine on
RewriteRule ^index/([a-zA-Z0-9]+)/$ index.php?id=$1

Apache Error Log

Invalid Command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration

Replace your rule with

RewriteRule ^index/([a-zA-Z0-9]+)/$ index.php?id=$1 [L]

aZ doesn't work the way one might think it does, and Az is just weird. That's what's throwing the error.

Also, adding the [L] flag prevents further rewriting.

您需要安装mod重写模块

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