PDA

View Full Version : How to replace %20 (space) in URL with "-"?


Sxperm
02-05-2006, 03:42 AM
Hi, I've use htaccess to rewrite some of my dynamic URLs like this
Content visible to registered users only.

and I've edit link.tpl to call like this
Content visible to registered users only.
to match my htaccess file. My problem is when URLs has been called, it will be displayed like this
http://www.estateround.com/Real-estate-directory-Listings-details-23-Bay%20Area%20Real%20Estate.html

There has some %20 in my url becuase {$link.TITLE} that queried from DB has their own spaces and its spaced has been automatically encoded to "%20" I want to replace "-" instead of "%20" Is there a way to do that?

Regards,
Sxperm

Boby
02-05-2006, 12:32 PM
%20 is the ecoded whitespace. It is not recommended to heave white space in your url, it can easily break, specially when you send it to someone else. This is why url are encoded and decoded when they are queried.

Instead of {$link.TITLE} there should be {$link.TITLE_URL} which has allready removed spaces and replaced the with "_". You don't have to make an url rewrite after it.

Boby

Sxperm
02-05-2006, 02:51 PM
Content visible to registered users only.

Thank you for your kindly replied but it did not work. The URL will shown as below
Content visible to registered users only.

It seems that they don't know what {$link.TITLE_URL} so they cannot call it for display, after "23-" is blank. Could you give me more some suggestion?

Best regards,
Sxperm

David
02-05-2006, 04:25 PM
Are you just tring to replace "_" with "-"?

Sxperm
02-05-2006, 04:46 PM
Content visible to registered users only.
Err..No David, I prefer to replace "-" or "_" instead of "%20". Could you give me any suggestion?

Best regards,
Sxperm

Sxperm
02-06-2006, 04:14 AM
Anyone help me please :oops: :lol:

Sxperm
02-07-2006, 09:16 AM
Please give me some suggestion :lol:

Ap0s7le
02-09-2006, 09:02 AM
I'll hook you up bro.

I'm PM'ing you.

-Casey

maxlinks
02-17-2006, 06:55 PM
Content visible to registered users only.

Check this:
Content visible to registered users only.

Sxperm
02-18-2006, 08:22 AM
Content visible to registered users only.

Check this:
Content visible to registered users only.[/quote]

Thank you very much :wink: It's work great for me. Thank you thank you.