| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Clean Url first letter | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Clean Url first letter
Hello,
How do i change the link http://store.com/Product-Name with http://store.com/product-name I've tried this method but didn't work
__________________
X-Cart v4.6 |
|||||||
#2
|
|||||||||
|
|||||||||
Re: Clean Url first letter
Of course you can manually change them to lower case. If you want the change to be automatic when you create a new product you will need to use JavaScript.
Personally, I don't see any seo benefit or hindrance using uppercase. Can you explain what you are trying to accomplish exactly? Are you wanting lowercase to be automatic when creating a URL, or are you wanting to rewrite all your URLS to lowercase? http://www.seoverflow.com/redirect-uppercase-urls-to-lowercase/
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
#3
|
|||||||
|
|||||||
Re: Clean Url first letter
First of all thank you for your response.
I know i can manually change them but i need to know if is there any solution to make them auto with lowercase. I want the lowercase to be automatic when creating a URL and i want to rewrite all URLS to all products that i already have in shop. How can i do that?
__________________
X-Cart v4.6 |
|||||||
#4
|
|||||||||
|
|||||||||
Re: Clean Url first letter
Here is a way to do it with .htaccess or httpd.conf:
http://www.askapache.com/htaccess/rewrite-uppercase-lowercase.html You could write a mysql query that would change all the entries in the database using the Lower() function: http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_lower To get it to be lowercase from now on automatically: http://stackoverflow.com/questions/154862/convert-javascript-string-to-be-all-lower-case Edit /common_files/js/check_clean_url.js Look at line 69 and find: to_field.value = from_field.value.replace(/[\&]/g, '-and-').replace(/[^a-zA-Z0-9._-]/g, '-').replace(/[-]+/g, '-').replace(/-$/, ''); Change it to: to_field.value = from_field.value.replace(/[\&]/g, '-and-').replace(/[^a-zA-Z0-9._-]/g, '-').replace(/[-]+/g, '-').replace(/-$/, '').toLowerCase();; All we have done is added ".toLowerCase();" to the end of the JavaScript expression. This will work for all new products you create that don't have a clean url value. Or if you remove the Clean URL and make some change to the product name than it will rewrite it for you.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
|
#5
|
|||||||
|
|||||||
Re: Clean Url first letter
This :
to_field.value = from_field.value.replace(/[\&]/g, '-and-').replace(/[^a-zA-Z0-9._-]/g, '-').replace(/[-]+/g, '-').replace(/-$/, '').toLowerCase();; works for me Thank you!
__________________
X-Cart v4.6 |
|||||||
#6
|
|||||||||
|
|||||||||
Re: Clean Url first letter
This is XC bug to me, I am sure QT will call it improvement
It has been like this since Clean URLs was first introduced. I am not sure why it was decided to just copy the words from the title and not make them all lowercase to begin with. The js solution above will get you by only when you create product or modify it in admin. If you are importing products or do auto populate Clean URLs form maintenance page this will not work. The php script involved still outputs the words as they are - so capital letters.... You need to change the outcome in include/func/func.clean_url.php as well
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
#7
|
|||||||
|
|||||||
Re: Clean Url first letter
Quote:
how to do then?
__________________
x-cart gold 4.7.12, www.eyewearuk.com - Eyewear Uk http://www.eyewearcanada.com - Eyewear Canada http://www.australiaglasses.com - Australia Glasses Glasses - How to Buy Eyeglasses Online www.cheapglasses123.com Glassess USA |
|||||||
#9
|
|||||||||
|
|||||||||
Re: Clean Url first letter
Quote:
That other thread is proof that this forum needs better search capabilities. Otherwise you would only have 5,000 posts.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
|
#10
|
|||||||||
|
|||||||||
Re: Clean Url first letter
Oh man I didn't even noticed... this feels like an anniversary
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
|
|||
X-Cart forums © 2001-2020
|