How can I capitalize the 1st. letter in urls in nop 4.1

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
5 years ago
How can I capitalize the 1st. letter in urls in nop 4.1?
I went to advanced to seo and changed the name but it keeps reverting back to friendly lower case names after saving.
5 years ago
Hi,
If you mean the url that appears in the navigation bar (eg. http://yoursite.com/Product-or-Category), by default friendly names be save in lowercase, but you could edit it from DB in field 'Slug' on 'UrlRecord' table.

I hope clear your question...
5 years ago
gniblack wrote:
How can I capitalize the 1st. letter in urls in nop 4.1?
I went to advanced to seo and changed the name but it keeps reverting back to friendly lower case names after saving.


Always use lowercase for URL, it is a standard.
5 years ago
I understand but I have a 7 year old .net .aspx website that has 2000 pages and most of them has a Camel naming convention with capital letters, I would like to keep the original page names or should I take the hit for changing that many page names to lower case by using 301 redirects, and whatever else strange that appears in nop 4.1?
5 years ago
I understand but I have a 7 year old .net .aspx website that has 2000 pages and most of them has a Camel naming convention with capital letters, I would like to keep the original page names or should I take the hit for changing that many page names to lower case by using 301 redirects, and whatever else strange that appears in nop 4.1?
5 years ago
Hi,

You should look at line number 1580,
name = name.Trim().ToLowerInvariant()
method name "GetSeName" in UrlRecordService.cs file.

Actually in c#, a string is case sensitive. Therefore, some people prefer to save string in a lower or upper case format to avoid string matching exercise. I think this is why it has been kept like what it is now in nopCommerce code.

You can simply set
name = name.Trim()
at line number 1580 inside UrlRecordService.cs file inside method name GetSeName and then modify rest of code accordingly to ensure there are unique SEO names regardless of their case.
5 years ago
Thank you soooo much NopAdvance, it works great.
5 years ago
@NopAdvance, It seem to only work for one page, additional pages are reverting back to seo friendly urls.
5 years ago
Hi,

What I told you was a way for you to find your solution. You can now look into code in similar way to solve for all other pages.
5 years ago
Thanks again, looking into it now.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.