Affiliate Marketing
Forum Search

Reply
 
LinkBack Thread Tools Display Modes

  #1 (permalink)  
Old 23-02-06
BFG 9000's Avatar
Coffee Drinker
 
Join Date: Jul 2005
Location: South UK
Posts: 243
Thanks: 9
Thanked 9 Times in 8 Posts
BFG 9000 is an unknown quantity at this point
  Quick bit of Mod Rewrite help please?

Hi Guys,

Like a fool, I've just sent a mailing out with an error.
In a link I have the following :-
Code:
products_id=products_id=123
Fairly obviously, this should be :-
Code:
products_id=123
What I'd like to do is use mod rewrite to allow this to work, what I'm trying at the moment is :-
Code:
RewriteEngine on
Options +FollowSymlinks
RewriteBase /
RewriteRule ^(.*)products_id=products_id(.*)$  $1products_id$2
But it doesn't seem to work.
Can anyone help please?


TTFN

BFG
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 23-02-06
chs's Avatar
chs chs is online now
Now then
 
Join Date: Oct 2005
Location: Newcastle Upon Tyne
Posts: 234
Thanks: 0
Thanked 3 Times in 3 Posts
chs is an unknown quantity at this point
I can't test this at the minute but have you tried adding an equals sign before the $2?

RewriteRule ^(.*)products_id=products_id(.*)$ $1products_id=$2
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 23-02-06
BFG 9000's Avatar
Coffee Drinker
 
Join Date: Jul 2005
Location: South UK
Posts: 243
Thanks: 9
Thanked 9 Times in 8 Posts
BFG 9000 is an unknown quantity at this point
Hi Mate,

Thanks - but it didn't work.
The problem is, I need to replace products_id=products_id= with products_id=.
I think the problem probably lies with the equals sign - I've tried esacaping it with \= but it still didn't work.

Anyone else?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 23-02-06
eskimo's Avatar
Registered User
 
Join Date: Aug 2003
Posts: 659
Thanks: 0
Thanked 0 Times in 0 Posts
eskimo is an unknown quantity at this point
try this


RewriteRule ^([^=]*)=([^=]*)=(*)$ products_id=$3
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #5 (permalink)  
Old 23-02-06
eskimo's Avatar
Registered User
 
Join Date: Aug 2003
Posts: 659
Thanks: 0
Thanked 0 Times in 0 Posts
eskimo is an unknown quantity at this point
actually if you know for sure the id will be numbers you could write a rule that grabs everything up to the numbers and ignores it, and everything else will be used.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 23-02-06
BFG 9000's Avatar
Coffee Drinker
 
Join Date: Jul 2005
Location: South UK
Posts: 243
Thanks: 9
Thanked 9 Times in 8 Posts
BFG 9000 is an unknown quantity at this point
Hmm.....

Code:
.htaccess: RewriteRule: cannot compile regular expression '^([^=]*)=([^=]*)=(*)$'\n
Doesn't like it...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 23-02-06
eskimo's Avatar
Registered User
 
Join Date: Aug 2003
Posts: 659
Thanks: 0
Thanked 0 Times in 0 Posts
eskimo is an unknown quantity at this point
I have to admit I'm very rusty at modrewrites.

It seems to me that the (.*) at the begining of your rule could be to blame. Surley this is grabbing the entire string?

It may be a better idea to use a literal match.
ie something like this.

^(products_id=products_id=)(.*)$ $1products_id=$2

I have to say I only brush up on modrewrites each time I need to use them.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Reply

Bookmarks


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

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Bloody Mod Rewrite!! Stress Head Widgets, Coding, AJAX, PHP - Technology & Affiliate Marketing 7 13-02-06 01:52 PM
Mod Rewrite help stevenm The Affiliate Marketing Lounge 11 31-10-05 12:23 PM
mod rewrite in root only tezar Widgets, Coding, AJAX, PHP - Technology & Affiliate Marketing 17 18-08-05 04:33 PM
Sub domains mod rewrite help wanted purple Widgets, Coding, AJAX, PHP - Technology & Affiliate Marketing 0 03-05-05 01:23 PM
Mod rewrite andy_jacko Widgets, Coding, AJAX, PHP - Technology & Affiliate Marketing 11 13-10-04 11:54 AM


Affiliate Marketing RSS Feeds - Contact Us - Affiliate Marketing - Archive - Privacy Statement - Top

Content Relevant URLs by vBSEO 3.2.0 RC7