Forum Moderators: open

Message Too Old, No Replies

Change urls but keep the same directory

Remove spaces from urls and replace with hyphens

         

Ruben

5:52 pm on Jun 28, 2004 (gmt 0)

10+ Year Member



I have some 4000 products indexed in Google. When i started the site i didn't know not to use spaces in urls. I have read some articles that hyphens are better. Now i want to change from spaces to hyphens. But i don't know how to do it. My urls are generated semi-automatically using php and the mod rewrite module. For example:

I now have:

www.123widgets.com/widgets/a r t i s t/s o n g.html

I want to change it to:

www.123widgets.com/widgets/a-r-t-i-s-t/s-o-n-g.html

The widgets dir is a php file which makes from the dirs and files some variables which i can use in my widgets.php file. I read something about some 301 redirects. But how can i do this in the same file widgets.php? Thus making the distinction between the hyphened and the unhyphened urls.