我使用wordpress,我有一些网址问题。WordPress的网址不工作
我目前的URL是服务器的IP地址:http://www.192.10.1.22/states/?q=ohio
我想网址:http://www.192.10.1.22/states/ohio
我用下面的functions.php文件的代码,它的工作在我 地方,但是当我上传cpanel然后它现在工作给我错误 页未找到。
function custom_rewrite_rule() {
add_rewrite_rule(
'states/([^/]*)/?',
'index.php/states/?q=$1',
'top');
}
add_action('init', 'custom_rewrite_rule', 10, 0);
我也使用下面的代码。
add_rewrite_tag('%states%', '([^&]+)');
global $wp;
$wp->add_query_var('q');
add_rewrite_rule(
'states/(\d*)$',
'index.php/states?q=$matches[1]',
'top'
);
我也更新固定链接和Apache的mode_rewrite也是。
那么我该如何解决这个问题?
谢谢!它的工作..非常感谢:) – samir
这是我的荣幸。 –