我有一個重寫規則.htaccess(它工作正常),我想添加爲WordPress wp_rewrite - 主要是爲了便攜性和用戶的方便...問題是如何正則表達式模式有看起來像.......htaccess WP_Rewrite正則表達式模式
RewriteCond %{REQUEST_URI} ^/services/rest/(.*)$
RewriteRule ^(.*)/(.*)/(.*)$ wp-content/plugins/some_plugin/api.php?action=$3 [L,NC]
,我將需要大約看起來像這樣的語法:
$newrules = array('^/services/rest/(.*)' => mAPI_PLUGIN_URL.'/socket.php?action=$matches[1]');
任何建議如何解決或如何改進呢?
你說它工作正常,那麼究竟是什麼問題?請澄清你的問題。 –
.htaccess工作正常(第一代碼片段) - 我正在尋找WP重寫語法(第二代碼片段)...爲推薦:http://codex.wordpress.org/Class_Reference/WP_Rewrite –