The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Help with couple of mod_redirect rules
Since, I just got rid of vbseo, now I am trying to deal with redirect as much as possible. Taking care of threads was easy however still urls like tags, attachments etc. remains.. so, I hope guys here may help me through with their wisdom in mod_rewrite rules .. regex
So, I am stuck on this.. wants to do following: redirect: domain.com/talk/tags/letter.html (letter is tag) To domain.com/talk/tags.php?tag=letter I tried this Code:
RewriteRule tags/([^/]+)\.html /tags.php?tag=$1 [L,R=301] My forum is at : domain.com/talk And I am adding above rule in domain.com/talk/.htaccess with "RewriteBase /talk/" . This is where I have added thread redirection code which works fine. |
#2
|
|||
|
|||
Hmm it should work fine..
What if you remove the slash before tags.php in your rewrite rule? |
#3
|
|||
|
|||
Nope its not working, and if I remove / from tags.php , it will add absolute path to the file.. but here first thing is that it should detect the rule at first place.
|
#4
|
|||
|
|||
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] |
#5
|
|||
|
|||
Could it be that an other rewrite rule is being applied before it reaches that one? Can you post all the contents of your .htaccess file?
|
#6
|
|||
|
|||
Quote:
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] Its like : Code:
http://domain.com/members/username/albums/my-updates/2451-user-privacy-security.jpg I did this : Code:
RewriteRule members.+/([\d]+)-.+\.jpg http://domain.com/talk/attachment.php?attachmentid=$1 [L,R=301] 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] |
#7
|
||||
|
||||
I know Joe @BirdOfPrey... oh ya,, vb doesn't do that
Well anyways, he helped me out tremendously with some redirects. Maybe He'll see this thread and post. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|