179 posts
  • Has referred 100+ members
  • Has sold $40,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Has been part of the Envato Community for over 4 years
+2 more
ThemePrince says

Hello all,

I have a problem: I’d like to create custom permalink for the categories but leave the rest intact. For example:

mysite.com/?cat=1 will be mysite.com/house mysite.com/?cat=3 will be mysite.com/lands

AND the rest stays intact:

mysite.com/?p=123 mysite.com/?page_id=96

I tried some htaccess rewrite tutorials but no success yet…

Thanks!

179 posts
  • Has referred 100+ members
  • Has sold $40,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Has been part of the Envato Community for over 4 years
+2 more
ThemePrince says

I solved it!

  • And I had to put these lines into the .htaccess file:
# BEGIN WordPress
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^houses$ ?cat=1 [L]
RewriteRule ^lands$ ?cat=3 [L]
# END WordPress
3447 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $750,000+ on Envato Market
  • Located in United States
  • Helps us moderate the forums
+10 more
sevenspark Moderator says

I solved it!
  • And I had to put these lines into the .htaccess file:
# BEGIN WordPress
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^houses$ ?cat=1 [L]
RewriteRule ^lands$ ?cat=3 [L]
# END WordPress

I believe you can accomplish this easily by going to Settings > Permalinks and under “Optional” > Category base just enter a dot (.)

I find that this works if the Custom Structure is set to /%category%/%postname%, but haven’t tested this for all permalink structures

EDIT : I realized this solution can screw up category archive paging, so your solution is probably better if it fixes that problem :)

by
by
by
by
by
by