Forum Moderators: phranque

Message Too Old, No Replies

Mod rewrite question, url problems

Mod rewrite question, url problems

         

aspkin

7:35 am on Aug 24, 2006 (gmt 0)

10+ Year Member



Hi,

I new to .htacess rewrite, but I managed to make it work for my site. Anyways, my URL's all have + signs between the titles.. example

[somesite.com...]

I was wondering if there was a way to have dashes instead of + signs?

either - or /

any help would be great, thanks!

Here is the code I'm using:

RewriteEngine on

RewriteRule ^(.+)Article([0-9]+)\.html(/)?$ articleDetail.php?id=$2&title=$1

RewriteRule ^(.+)\.html(/)?$ $1.php

aspkin

11:01 pm on Aug 24, 2006 (gmt 0)

10+ Year Member



anyone?

How do I change the + signs to - signs in my urls?

Or is that even possible?

aspkin

7:32 am on Aug 25, 2006 (gmt 0)

10+ Year Member



Ok I figured out what was causing the + signs in my urls, its the actually code in my php file.

<a href="<?php echo stripslashes(urlencode($title));?>+Article<?php echo $id?>.html"><?php echo stripslashes($title);?>...</a>

I also just learned that Search engines don't read the '+' signs, they actually convert them to %20 meaning a space... this is not good when they come around to reindex my site, none of my urls will work.

Anyone, anyone at all, how would I fix this problem!?!

Regards,

jdMorgan

2:41 pm on Aug 25, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Change the plus signs to minus signs in your script. Or change the spaces in your database to hyphens.

What is on your pages determines the URL that visitors and search engines see, and nothing else can change it.

Jim