2010-12-21 53 views
1

我已經能夠通過輸入/%category%/%postname%/並使用下面顯示的代碼片段作爲我的.htacccess文件在Wordpress中設置適當的固定鏈接重定向。 - 太棒了!用.htaccess重寫基於日期的URL:解決方案?

<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteBase /subfolder/ 
RewriteRule ^index\.php$ - [L] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule . /subfolder/index.php [L] 
</IfModule> 

但是嘗試訪問鏈接到歸檔的帖子,如「2010年12月」(在側邊欄顯示)時,我得到這個頁面:http://localhost/subfolder/2010/10/

我怎麼能代替重寫所有基於日期的請求到以下頁面? http://localhost/subfolder/archive/2010/10/

感謝

回答

1

廣告在此之前你的最後一條規則:

的RewriteCond%{REQUEST_URI}子文件夾/ \ d {4}/\ d {2}

然後添加新的規則例如

RewriteRule子文件夾/(\ d {4})/ \ d {2} /)存檔/ $ 1 [L]