I am coding a site and have key words in the URLs like this:
?s=2010%20Federal%20Spending&id=115
The Part that has the title “2010 Federal Spending” is not used for navigation; it is completely ignored by my site’s navigation. My site just pays attention to the ‘id’, not the ‘s’. Again, the title is just there for SEO reasons.
Is there a PHP function to clean up this portion of the URL? For example, replace the ‘%20’ with ‘-‘ or something similar?
Use urldecode($your_string) in case you’d like to decode URLs. Since space is not a valid URL character, maybe you should try to replace the spaces in the title before you even use it as an address.
You could also remove other CHARS that might cause some problems such as “&”