Quote:
Originally Posted by kh99
Maybe you want [^.], like
Code:
RewriteRule /tags/([^.]+)\.html /tags.php?tag=$1 [L,R=301]
ETA: Hmm...or in case tags can show up elsewhere in the path, maybe both . and /, like
Code:
RewriteRule /tags/([^./]+)\.html /tags.php?tag=$1 [L,R=301]
|
Thanks guys, it worked with following: (and yes there were some conflicting rules from default vb)
Code:
RewriteRule tags/([^.]+)\.html /talk/tags.php?tag=$1 [L,R=301]
Now I need to handle attachment urls :
Its like :
Code:
http://domain.com/members/username/albums/my-updates/2451-user-privacy-security.jpg
Here 2451 is image ID:
I did this :
Code:
RewriteRule members.+/([\d]+)-.+\.jpg http://domain.com/talk/attachment.php?attachmentid=$1 [L,R=301]
Again not working..
No matter how much I read about regex, its always confusing for me, can you guys confirm if I read it correct :
[^/] mean any character except /
so,
[^./] means any character exept . and /
am I reading it right ?
--------------- Added [DATE]1443051370[/DATE] at [TIME]1443051370[/TIME] ---------------
Well.. I donno but now its working .. for precaution I have added condition for attachment url redirect:
Code:
#image attachment
RewriteCond %{REQUEST_URI} /albums/ [NC]
RewriteRule members.+/([\d]+)-.+\.jpg http://domain.com/talk/attachment.php?attachmentid=$1 [L,R=301]
Is it as I think, ie. first checking condition if URI contains /albums/ word and then only proceed for further match and redirect ?