2014-03-27 123 views
0

我有Apache/2.2.22(Ubuntu)。网站目录:Mod_rewrite返回404错误

.htaccess 
index.php 
catalog.php 

当我在浏览器中键入:

site.local/about-company - redirect to index.php 
site.local/faq - redirect to index.php 
site.local/catalog - return 404 

**.htaccess** 
DirectoryIndex index.php 
RewriteEngine On 
Options +FollowSymlinks 
RewriteCond %{REQUEST_FILENAME}  !-d 
RewriteCond %{REQUEST_FILENAME}  !-f 
RewriteRule ^(.*)$ index.php 
+0

当用户输入'catalog'时,你期待什么? –

+0

我希望重定向到index.php –

+0

尝试在规则中附加标志'RewriteRule ^(。*)$ index.php [R = 302,L]' –

回答

0

的Ubuntu 14.04只的Apache/2.4.7 这个版本的Apache与mod_rewrite的模块中的错误。 现在http://apache.org实际版本是2.4.9。使用这个或在Ubuntu Server中等待2.4.9。