简体   繁体   English

URL重写在htaccess的生产环境中不起作用

[英]URL rewriting don't work in production with htaccess

I'm trying to use URL rewriting with htaccess, it works on local but failed on production. 我正在尝试将htaccess与URL重写一起使用,它可在本地运行,但在生产上失败。 My host is 1and1. 我的主机是1and1。

My url is : 我的网址是:
https://website.com/service.php?id=100&title=page-title https://website.com/service.php?id=100&title=page-title

and I would like 我想
https://website.com/service/100/page-title.html https://website.com/service/100/page-title.html

I use this in my .htaccess 我在.htaccess中使用它

Options +FollowSymlinks
RewriteEngine On
RewriteBase /

RewriteRule ^service/([^/]*)/([^/]*)\.html$ /service.php?id=$1&title=$2 [L]

Any idea about this error ? 对这个错误有任何想法吗?

I found the error, need to add Options -MultiViews in .htaccess 我发现了错误,需要在.htaccess中添加Options -MultiViews
Thx 谢谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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