Prashant
Prashant

Reputation: 5461

htaccess redirect remove category slug from url

Using .htaccess file in apache server, how can I get

http://mysite/[category]/[post-title]

redirect to

http://mysite/[post-title]

where [category] and [post-title] could be any category name and post-titles respectively.

please help.

thanks

Upvotes: 0

Views: 1772

Answers (2)

if you are using wordpress i recommend that plugin

WP No Category Base

it works like a charm with my blog

Upvotes: 0

Jon Lin
Jon Lin

Reputation: 143906

Try:

RedirectMatch 301 ^/[^/]+/([^/]+)/?$ /$1

Upvotes: 1

Related Questions