2013-07-08 99 views
0

我想獲得/博客和/博客轉發到Apache中使用mod_rewrite blog.php。我最初有與/博客的一部分,這是在這裏沒有問題:mod_rewrite轉發/博客和/博客到一個PHP文件

RewriteEngine on 
RewriteCond %{REQUEST_URI} ^/blog 
RewriteCond /blog/%{REQUEST_FILENAME} !-d 
RewriteRule /blog/([0-9]+)$ /blog.php?blog=$1 
RewriteRule /blog/dates/?([^/]*)/?([^/]*)/?([^/]*)/?$ /blog.php?year=$1&month=$2&day=$3 

我試圖讓全案版本RewriteMap指令工作;但是,我沒有成功。 然後我嘗試了RewriteCond%{REQUEST_URI} ^/[b,B]日誌,對於其他重寫也是如此,但沒有成功。

如果任何人都可以借鑑如何讓/ blog和/ Blog轉發到blog.php,我將不勝感激。

回答

1

您可以使用標誌NC來區分不區分大小寫。

RewriteCond xxxxxx [NC] 
RewriteRule xxxxxxx [NC] 
+0

工作就像一個魅力!謝謝! –