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

标签 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

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

The requested URL /EZsample/login/mereco-technologies/ was not found on this server.

谁能帮帮我!

最佳答案

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

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

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

关于php - .htaccess URL 重写错误 - 在此服务器上找不到请求的 URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28231220/

相关文章:

apache - 禁止访问您无权访问/在此服务器上

regex - .htaccess mod_rewrite 超薄路由

apache - 使用.htaccess重定向主域但不重定向某些子域

.htaccess - 交响乐2 : How to remove the "/web/" folder from the url in a shared hosting?

PHPExcel Style获取默认数字格式

php - 来自命令行的瑞典字符的utf8问题

php - 将值插入两个相关表中

javascript - 为什么会有人将(Apache mod_expires 参数)ExpiresByType 设置为 "access plus 0 seconds"?

apache - httpd.conf、php.ini 和 .htaccess 之间的区别

php - 在 Linux/Mac 上使用带有 Adodb5 的 odbc mssql 连接到 SQL Server