Apache mod rewrite problem in .htaccess file.
-
Guys, If I have my category url in the format
mysite.com/?category_name=$1&paged=$2
i.e mysite.com/category/category_name/page/numberHow can I make apache to rewrite it as mysite.com/$1/page/$2 i.e :mysite.com/categoryname/page/number
I’ve found that I need the code below to rewrite my category urls to mysite.com/$1/page/$2
RewriteEngine On
RewriteRule ^([^/]*)/page/([^/]*)$ /?category_name=$1&paged=$2 [L]But I have a problem with that snippet.It might be because wordpress has put some piece of code into .htaccess file which doesn’t seem to be compatible with the rewrite code I have used.
How can I use
RewriteEngine On
RewriteRule ^([^/]*)/page/([^/]*)$ /?category_name=$1&paged=$2 [L]with wordpress’
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule># END WordPress
so that I can Have my category url as mysite.com/category-name/page/numberI was using Top Level Categories plugin to remove the word category from
mysite.com/<strike>category</strike>/<category-name/page/number.But the plugin doen’t seem to work with 2.5 of wordpress.
even the 1.01th version of the plugin is not working for me.Search engine has crawled all my category pages without the word category in the url, It will be bad for my site if crawler comes before I fix the bug,Please help me
- The topic ‘Apache mod rewrite problem in .htaccess file.’ is closed to new replies.