Forum Moderators: phranque

Message Too Old, No Replies

Use htaccess to remove "category" from wordpress

wordpress, htaccess

         

bucknasty

7:02 pm on Feb 1, 2010 (gmt 0)

10+ Year Member



Wondering, can I use my htaccess file to remove the "category" base in wordpress? Any info would be appreciated.

Thanks

jdMorgan

8:27 pm on Feb 1, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



No. .htaccess cannot 'remove' anything.

If you can configure WP to not publish "category" in the URL, you can use mod_rewrite to 'put it back in' as long as the URL still carries enough information for mod_rewrite to know by looking at the URL that it needs to do so.

URLs are defined by links on your pages. Once those links appear on your pages, they are fixed and they 'exist' -- whether or not they resolve to any existing file on any server.

Mod_rewrite acts after an HTTP URL request arrives at your server, and before any content it served. Therefore, it cannot 'change the URLs' that you publish on your pages.

Look into the various "SEF" plug-ins for WP if you want to change your links.

Jim

bucknasty

12:04 am on Feb 2, 2010 (gmt 0)

10+ Year Member



Thank you sir