Apache 搜索引擎友好链接不工作

Apache 搜索引擎友好链接不工作,apache,.htaccess,Apache,.htaccess,唯一有效的是www.foo.com和foo.com(基本上是index.php) 这是我的.htaccess文件 Options +FollowSymLinks Options -MultiViews RewriteEngine on RewriteBase / RewriteCond %{http_host} ^foo\.com$ [NC] RewriteRule ^(.*)$ http://www.foo.com/$1 [r=301] RewriteRule ^(.*)$ bar.com/p

唯一有效的是www.foo.com和foo.com(基本上是index.php)

这是我的.htaccess文件

Options +FollowSymLinks
Options -MultiViews
RewriteEngine on
RewriteBase /
RewriteCond %{http_host} ^foo\.com$ [NC]
RewriteRule ^(.*)$ http://www.foo.com/$1 [r=301]
RewriteRule ^(.*)$ bar.com/public_html/$1

RewriteRule review(s?)(\/?)$ /bar.com/public_html/reviews.php
RewriteRule products(\/?)$ /bar.com/public_html/products.php

如果我删除尾随斜杠,有些地址可以工作,其他地址会给我一个带或不带尾随斜杠的404。

解决:我通过采用页面重写规则(即*.php)并将它们放在bar.com/public\u html/目录的.htaccess文件中来解决它。