2014-03-24 30 views
0

我想在Wordpress的.htaccess中添加我自己的規則。Wordpress,.htaccess中的自定義mod_rewirte

我有這樣的事情

http://page.com/materialy/?id_s=2&nazwa=stale-niestopowe

我想是這樣的:

http://page.com/materialy/s/2/stale-niestopowe

我嘗試了一些插件,WP,但它dosent工作,因爲在我的自定義I頁使用[insert_php]

如何編輯.htaccess使其工作?

請幫忙!

+0

使用本地worpdress固定鏈接! http://codex.wordpress.org/Using_Permalinks –

+0

我使用固定鏈接。但在我的自定義頁面中,我使用自己的PHP代碼和自己的變量。 – pr0metheus

+0

太好了。然後將重寫規則添加到您自己生成的鏈接。看到這個作爲添加自定義規則的例子http://stackoverflow.com/questions/22115103/how-to-remove-author-base-in-wordpress/22194527#22194527 –

回答

0

如果您想手動執行此操作,請按照下列步驟操作。

打開.htaccess文件並對其進行編輯。添加這些行

RewriteEngine On 
RewriteRule ^([^/]*)/([^/]*)\.html$ /materialy/?id_s=$1&nazwa=$2 [L] 

輸出:

http://www.page.com/2/stale-niestopowe.html