.htaccess URL 重写错误 - 在此服务器上找不到请求的 URL

Mar*_*ton 5 php apache .htaccess mod-rewrite

我有一个非常简单的重写规则。我的整个.htaccess文件如下:

RewriteEngine On

RewriteRule ^login/([a-zA-Z0-9-/]+)$ company-page.php?company_url=$1
RewriteRule ^login/([a-zA-Z0-9-/]+)/$ company-page.php?company_url=$1
Run Code Online (Sandbox Code Playgroud)

这可以在本地 Wamp 服务器上完美运行,但不能在在线服务器上运行。它显示以下错误。!

The requested URL /EZsample/login/mereco-technologies/ was not found on this server.
Run Code Online (Sandbox Code Playgroud)

谁能帮我!

小智 1

如果您使用的是 VPS,请使用这篇文章,

1.确保您已启用Mod_Rewrite?2.修改虚拟主机配置

https://www.digitalocean.com/community/tutorials/how-to-set-up-mod_rewrite