apache - .htaccess modrewrite problem -



apache - .htaccess modrewrite problem -

i have website on wordpress , have written plugin required seo friendly url stuck @ following

http://domain.com/catalogue-category/1/ working fine when replace /1/ name of category http://domain.com/catalogue-category/seating/ not work @ , gives me 404 error.

its working @ /catalogue-category/?cat=seating

my apache rewrite rule

rewriterule ^catalogue-category/^([^/]+)/$ /catalogue-category/?cat=$1 [l]

i not in mod rewrite in php, please bear ignorance , treat me rookie.

looking forwards hear gurus :)

try:

rewriterule ^catalogue-category/([^/]+)/$ /catalogue-category/?cat=$1 [l]

you using caret ^ twice in regex pattern (^catalogue-category/^([^/]+)/$), caret asserts match should start of string.

pattern explanations previous pattern: assert position @ origin of string «^» match characters “catalogue-category/” literally «catalogue-category/»assert position @ origin of string «^» match regular look below , capture match backreference number 1 «([^/]+)» match character not “/” «[^/]+» between 1 , unlimited times, many times possible, giving needed (greedy) «+» match character “/” literally «/» assert position @ end of string (or before line break @ end of string, if any) «$» suggested one assert position @ origin of string «^» match characters “catalogue-category/” literally «catalogue-category/» match regular look below , capture match backreference number 1 «([^/]+)» match character not “/” «[^/]+» between 1 , unlimited times, many times possible, giving needed (greedy) «+» match character “/” literally «/» assert position @ end of string (or before line break @ end of string, if any) «$»

apache wordpress .htaccess mod-rewrite wordpress-plugin

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -