.htaccess wordpress htaccess重写

.htaccess wordpress htaccess重写,.htaccess,.htaccess,我有一个wordpress博客 我的问题是。如何重写此url www.1234.com/?s=&cp_state=city 关于这个 www.1234.com/city 尝试在WP指令或任何其他指令之前,将这些行添加到根目录中的.htaccess文件中。例如: #These are the 2 lines to add RewriteEngine On RewriteRule ^(city)/?$ ?s=&cp_state=$1 [L] #End of added lines

我有一个wordpress博客

我的问题是。如何重写此url

www.1234.com/?s=&cp_state=city
关于这个

www.1234.com/city

尝试在WP指令或任何其他指令之前,将这些行添加到根目录中的.htaccess文件中。例如:

#These are the 2 lines to add
RewriteEngine On
RewriteRule ^(city)/?$ ?s=&cp_state=$1 [L]
#End of added lines

# BEGIN WordPress - This is just an example, there might be more or different.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress - WP directives end here  
应显示字符串“cp_state=city”

<?php
if ($_GET['cp_state'] == 'city') {
    echo "cp_state = city<br /><br />";
}
?>