Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 23 Sep 2015, 16:34
Jaffery Jaffery is offline
 
Join Date: Dec 2009
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


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

But its not working.

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.
__________________
.....
Reply With Quote
  #2  
Old 23 Sep 2015, 18:23
Dave Dave is offline
 
Join Date: Jun 2010
Real name: Dave
Hmm it should work fine..
What if you remove the slash before tags.php in your rewrite rule?
__________________
https://technidev.com - security, development, exploits, vBulletin
dave[at]technidev[dot]com

Contact me for custom vBulletin 3/4 work & server/website management.
Reply With Quote
  #3  
Old 23 Sep 2015, 21:37
Jaffery Jaffery is offline
 
Join Date: Dec 2009
Originally Posted by Dave View Post
Hmm it should work fine..
What if you remove the slash before tags.php in your rewrite rule?
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.
__________________
.....
Reply With Quote
  #4  
Old 23 Sep 2015, 21:59
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
Maybe you want [^.], like

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


ETA: Hmm...or in case tags can show up elsewhere in the path, maybe both . and /, like

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #5  
Old 23 Sep 2015, 22:04
Dave Dave is offline
 
Join Date: Jun 2010
Real name: Dave
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?
__________________
https://technidev.com - security, development, exploits, vBulletin
dave[at]technidev[dot]com

Contact me for custom vBulletin 3/4 work & server/website management.
Reply With Quote
  #6  
Old 24 Sep 2015, 00:30
Jaffery Jaffery is offline
 
Join Date: Dec 2009
Originally Posted by kh99 View Post
Maybe you want [^.], like

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


ETA: Hmm...or in case tags can show up elsewhere in the path, maybe both . and /, like

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Thanks guys, it worked with following: (and yes there were some conflicting rules from default vb)



Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Now I need to handle attachment urls :

Its like :

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Here 2451 is image ID:

I did this :


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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 24 Sep 2015 at 00:36 ---------------

Well.. I donno but now its working .. for precaution I have added condition for attachment url redirect:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Is it as I think, ie. first checking condition if URI contains /albums/ word and then only proceed for further match and redirect ?
__________________
.....
Reply With Quote
  #7  
Old 24 Sep 2015, 00:49
Brandon Sheley's Avatar
Brandon Sheley Brandon Sheley is offline
 
Join Date: Mar 2005
Real name: Brandon
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.
__________________

Email me for website help: brandon[at]sheley[dot]org
Reply With Quote
Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mini Mods Signature Rules - post rules for users to follow SonicGT vBulletin 4.x Add-ons 40 04 Feb 2016 09:09
Forum Display Enhancements New look for Posting Rules (Rules at the bottom of forum display) Hell Bomb vBulletin 3.8 Template Modifications 5 14 Nov 2010 02:18
BLS - addon to RULES AND USER AGREEMENT HACK: rules to selected forum Bolas vBulletin 3.0 Full Releases 21 25 Nov 2006 15:16
BLS - addon to RULES AND USER AGREEMENT HACK: rules to child forum Bolas vBulletin 3.0 Full Releases 0 13 Apr 2005 23:35



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 04:06.

Layout Options | Width: Wide Color: