How to Allow Uppercase in URL and Alias

Discuss Search Engine Optimization in relation to Joomla! 2.5. This forum will also have discussions on SEF/SEO Joomla! 2.5 extensions.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
aotf01
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Sun Apr 19, 2009 2:58 am

How to Allow Uppercase in URL and Alias

Post by aotf01 » Mon Jan 30, 2012 12:17 am

Alias and SEO URLs are automatically converted to lowercase. How can I get Joomla to allow uppercase URLs?

In 1.5 this was accomplished by editing:
libraries/joomla/filter/filterout.php line 94

Code: Select all

$str = trim(strtolower($str));
to

Code: Select all

$str = trim($str);
I tried editing the following in 2.5 but it still converted it to lowercase:
libraries/joomla/filter/output.php line 95 & 132

Code: Select all

$str = trim(JString::strtolower($str));
to

Code: Select all

$str = trim($str);

aotf01
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Sun Apr 19, 2009 2:58 am

[SOLVED] How to Allow Uppercase in URL and Alias

Post by aotf01 » Sat Mar 24, 2012 7:57 pm

I figured it out.
To make Joomla 2.5 leave capital letters in the Alias and URL edit the following files:

./libraries/joomla/filter/output.php comment out line 95:

Code: Select all

//$str = trim(JString::strtolower($str));
and change to:

Code: Select all

$str = trim($str);
./libraries/joomla/language/language.php comment out line 370:

Code: Select all

//$string = JString::strtolower($string);

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44072
Joined: Sat Apr 05, 2008 9:58 pm

Re: How to Allow Uppercase in URL and Alias

Post by Webdongle » Sat Mar 24, 2012 10:56 pm

URL's are always lower case.
http://forum.joomla.org is the same as http://foRum.JOOmLa.org

Put foRum.JOOmLa.org into the url bar of your Browser and see
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

aotf01
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Sun Apr 19, 2009 2:58 am

Re: How to Allow Uppercase in URL and Alias

Post by aotf01 » Sat Apr 07, 2012 6:21 am

The reason "foRum.JOOmLa.org" returns as all lower case is because top level domains are all lowercase, but Joomla also forces the rest of the URL to lowercase when this is not necessary (see http://en.wikipedia.org/wiki/Uniform_Resource_Locator [note how U, R, and L are uppercase]). The reason I want this is because I have several URLs with proper names that I would like to preserve.

The above solution also did not work. It did successfully save as uppercase in the MySQL database, but the pages would not display due to an input filter. The simplest solution for me was to create a hidden menu (not linked to a module). This allowed a External Link to remain capitalized without any editing of the php.

Create Joomla! Link With Uppercase URL

1. Create Article
Title: Article Name
Alias: article-name

2. Add New Hidden Menu Item
Menu Type: Single Article
Select Article
Menu Title: Article Name
Alias: menu-name

3. Add New Menu Item
Menu Type: External URL
Menu Title: Article-Name
Link: Article-Name

4. Add Menus to Article
Menus - Menu Manager
Click "Modules Linked" for each Menu
Check article box in each menu (Hidden & Other)

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44072
Joined: Sat Apr 05, 2008 9:58 pm

Re: How to Allow Uppercase in URL and Alias

Post by Webdongle » Sat Apr 07, 2012 11:06 am

I see what you mean. Interesting to note that on my 1.5 site
using joomla-faq/Updating-joomla.html instead of joomla-faq/updating-joomla.html results in a 404
but
On my 2.5.3 site using using-joomla/Extensions.html instead of using joomla/extensions.html finds the page.
???
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".


Locked

Return to “Search Engine Optimization (Joomla! SEO) in Joomla! 2.5”