wordpress를 사용하고 있습니다. 일부 URL 문제가 있습니다.Wordpress URL이 작동하지 않습니다.
나의 현재 URL은 서버의 IP 주소입니다 : http://www.192.10.1.22/states/?q=ohio
내가 원하는 URL : 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'
);
또한 permalink 및 apache mode_rewrite도 업데이트됩니다.
어떻게이 문제를 해결할 수 있습니까?
감사합니다! 그것은 작동 중입니다 ... 고마워요 :) – samir
그것은 내 기쁨입니다. –