Haris Haris - 8 days ago 6
Apache Configuration Question

Redirect URL with mod rewrite

I want to redirect this type of link:

http:example/categories/subcat1,122


to this type:

http:example/categories/cat1/subcat1


For every cat2 there will be one cat1 that i will insert on rewrite rules.e.g for:

http:example/categories/subcat2,324


i need

http:example/categories/cat2/subcat2

Answer

You can use this rule in your site root .htaccess:

RewriteEngine On

RewriteRule ^(katigories)/(aggeioxeiroyrgoi), /$1/ygeia/$2? [L,NC,NE,R=301]

# rest of your rewrite rules go below
Comments