zehrila Posted June 6, 2011 Share Posted June 6, 2011 Okay, by default my urls structure is in mixed case, e.g domain.com/Green-Blue-Widgets.html and Google for some reasons is indexing two versions of my urls domain.com/Green-Blue-Widgets.html and domain.com/green-blue-widgets.html . Now i want to 301 redirect all urls to lowercase, but my internal navigation is all mixed case e.g the category page domain.com/Green has all the products listed in the page with mixed case. I know its bad programming, but i will really appreciate if any one can look into the matter for me and usggest a solution. Quote Link to comment Share on other sites More sharing options...
WebStyles Posted June 6, 2011 Share Posted June 6, 2011 strtolower() will convert a string to lower case. Quote Link to comment Share on other sites More sharing options...
zehrila Posted June 6, 2011 Author Share Posted June 6, 2011 you mean the internal navigation? so i should place strolower to internal navigation/url structure and then use 301 rewrite to force all mixed case urls to redirect to lowercase? Quote Link to comment Share on other sites More sharing options...
WebStyles Posted June 6, 2011 Share Posted June 6, 2011 from what I gather, you have a database with words like "Green", "Blue", "Whatever" that you use to list stuff and then build urls, is that correct? in that case you should either convert all to lowercase in database and user ucwords() before displaying them (so they look nice for the visitor) and the raw output to build the links, or the inverse: don't change anything, present the raw output to the visitor, but build the urls with strtolower() to ensure they're all lowercase. (I may be misinterpreting you problem) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.