所以,我将website.com移到了subdomain.website.com。 .htaccess文件位于website.com/subdomain/文件夹中,它应该可以正常工作但不起作用。
错误消息:在此服务器上找不到请求的URL / title-123。
它的基本功能是将website.com/product.php?id=123&title=hello翻译为website.com/hello-123
尝试访问subdomain.website.com/title-123
时产生错误<IfModule mod_rewrite.c>
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteCond %{THE_REQUEST} \s/product\.php\?id=([0-9]+)&title=([^\s&]+)\s [NC]
RewriteRule ^ %2-%1? [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+?)-([0-9]+)$ product.php?id=$2&title=$1 [L]
</IfModule>
任何人都知道如何解决这个问题?谢谢!
答案 0 :(得分:0)
经过大量研究和调试apache conf文件并接受专家的帮助后,我设法修复了它,完全删除了.htaccess文件并直接在apache VirtualHost中添加了重写规则。