|
NYDAz
|
 |
« on: September 12, 2009, 09:48:54 AM » |
|
anyone knows how can I exclude this sign ® from my url ? I'm thinking that this is possible with htaccess ! *But I want the anchor text to remain the same ! 
|
|
|
|
|
Logged
|
I'm an educated fool, with money on my mind !
|
|
|
|
perkiset
|
 |
« Reply #1 on: September 12, 2009, 11:29:52 AM » |
|
I don't get it NYD. Do you mean that some search phrase is coming in and you're getting that code on the URL? But wouldn't you have put it there in the first place? Very lost. 
|
|
|
|
|
Logged
|
It's the things you learn after you know it all that really count. -John Wooden
|
|
|
|
NYDAz
|
 |
« Reply #2 on: September 12, 2009, 11:36:49 AM » |
|
No perk  I've modified a CMS which is working with a datafeed ! So when I upload the datafeed .... the URL are generated automatically ! I want to put the trademark symbol on links but not on urls ! Example : Name of product in my datafeed : Inspiron® 1510 and the url generated automatically would be : http://www.myexample.com/dell/Inspiron®-1510.html The page title would be : Dell Inspiron® 1510 the description : Find the best price for Dell Inspiron® 1510 ! the h1 tage : Dell Inspiron® 1510 but I want to remove that sign from the URL that should be something like this : http://www.myexample.com/dell/Inspiron-1510.htmlI hope I'm more clear now 
|
|
|
|
|
Logged
|
I'm an educated fool, with money on my mind !
|
|
|
|
perkiset
|
 |
« Reply #3 on: September 12, 2009, 11:51:02 AM » |
|
Please post the ORIGINAL UNCONVERTED Url here as you see it - wrap it in [ code ] like you would source code so that I can see it please.
|
|
|
|
|
Logged
|
It's the things you learn after you know it all that really count. -John Wooden
|
|
|
|
NYDAz
|
 |
« Reply #4 on: September 12, 2009, 11:57:16 AM » |
|
Please post the ORIGINAL UNCONVERTED Url here as you see it - wrap it in [ code ] like you would source code so that I can see it please.
PM'ed to you !
|
|
|
|
|
Logged
|
I'm an educated fool, with money on my mind !
|
|
|
|
NYDAz
|
 |
« Reply #5 on: September 12, 2009, 12:28:40 PM » |
|
you got my PM perk ? 
|
|
|
|
|
Logged
|
I'm an educated fool, with money on my mind !
|
|
|
|
perkiset
|
 |
« Reply #6 on: September 12, 2009, 12:31:56 PM » |
|
hang tough ... getting some family biz sorted, be right there...
|
|
|
|
|
Logged
|
It's the things you learn after you know it all that really count. -John Wooden
|
|
|
|
perkiset
|
 |
« Reply #7 on: September 12, 2009, 12:36:19 PM » |
|
Thought it'd look like that.
$newURL = str_replace('%C2%AE', '', $inputURL);
That'll do ya. the %AE is the trademark, the C2 is a circumflex capital A, I don't know why that's in there, but you'll want to get rid of it as well.
another option would be to:
$newURL = preg_replace('/\%[0-9]{2}/', '', $inputURL) which would get rid of any chars like that in an input string.
|
|
|
|
|
Logged
|
It's the things you learn after you know it all that really count. -John Wooden
|
|
|
|
NYDAz
|
 |
« Reply #8 on: September 12, 2009, 12:40:08 PM » |
|
hang tough ... getting some family biz sorted, be right there...
no problem ... family first Thought it'd look like that.
$newURL = str_replace('%C2%AE', '', $inputURL);
That'll do ya. the %AE is the trademark, the C2 is a circumflex capital A, I don't know why that's in there, but you'll want to get rid of it as well.
another option would be to:
$newURL = preg_replace('/\%[0-9]{2}/', '', $inputURL) which would get rid of any chars like that in an input string.
I'll try that ... and comeback with the results Thanks for your input perk 
|
|
|
|
|
Logged
|
I'm an educated fool, with money on my mind !
|
|
|
|
Bompa
|
 |
« Reply #9 on: September 12, 2009, 06:21:51 PM » |
|
Thought it'd look like that.
$newURL = str_replace('%C2%AE', '', $inputURL);
That'll do ya. the %AE is the trademark, the C2 is a circumflex capital A, I don't know why that's in there, but you'll want to get rid of it as well.
another option would be to:
$newURL = preg_replace('/\%[0-9]{2}/', '', $inputURL) which would get rid of any chars like that in an input string.
perk, that regex would remove a % sign if followed by two digits 0-9, correct?
|
|
|
|
|
Logged
|
Do You Know?
|
|
|
|
deregular
|
 |
« Reply #10 on: September 12, 2009, 10:39:33 PM » |
|
Wouldnt this sort of thing suffice? Allowing only alpha numeric through?
$string = preg_replace('#\W#','',$string);
|
|
|
|
« Last Edit: September 12, 2009, 10:43:52 PM by deregular »
|
Logged
|
|
|
|
|
perkiset
|
 |
« Reply #11 on: September 13, 2009, 01:00:28 AM » |
|
Wouldnt this sort of thing suffice? Allowing only alpha numeric through?
$string = preg_replace('#\W#','',$string);
He needs to ditch the hex code, in this case AE and 2C - literally, in the URL there is %2C%AE ... you want to ditch the actual 2C and AE. perk, that regex would remove a % sign if followed by two digits 0-9, correct?
That's what it's supposed to do Bomps... did I get it wrong? AH ... I see it now... you are right bomps, I forgot to grab the hex part. The command should actually be: $cleanURL = preg_replace('/\%[0-9A-F]{2}/i', '', $inURL); Thanks Bomps.
|
|
|
|
|
Logged
|
It's the things you learn after you know it all that really count. -John Wooden
|
|
|
|
NYDAz
|
 |
« Reply #12 on: September 13, 2009, 08:50:39 AM » |
|
|
|
|
|
|
Logged
|
I'm an educated fool, with money on my mind !
|
|
|
|
deregular
|
 |
« Reply #13 on: September 13, 2009, 11:16:52 AM » |
|
He needs to ditch the hex code, in this case AE and 2C - literally, in the URL there is %2C%AE ... you want to ditch the actual 2C and AE.
Gotcha, now i see where you were going with it. NYDaz, it would go in one of your classes. As far as I know you cant run php code in .htaccess.
|
|
|
|
|
Logged
|
|
|
|
|
perkiset
|
 |
« Reply #14 on: September 13, 2009, 12:40:36 PM » |
|
No... you can't do any such thing as I just demonstrated in .htaccess. I assumed you were already at a PHP level ... this could be my mistake ... I see everything through the lens of how I do things, which is to take ALL requests and funnel them into a single PHP process for handling... I apologize NYD.
This could be done with mod_rewrite though ... I THINK. I am not sure if the regex processor for mod_rewrite is strong enough - Dirk or Bompa would be better suited than me for this one.
Paging, Dirk and Bompa...
|
|
|
|
|
Logged
|
It's the things you learn after you know it all that really count. -John Wooden
|
|
|
|