Wordpress site acting differently in different browsers

Hi,

I created a wordpress website for my duaghter’s wedding. She sent out her wedding invitation and on it the website URL was printed in all capital letters. When people cut and paste the link into the URL bar, it opens properly in Chrome. But it does not open in Internet Explorer or Firefox. The wedding website is in a sub directory. capitalization of the “Jenn and Lucas” seems to be causing some problem. Can anyone help me figure out how I can correct this?

HTTP://WWW.SITESBYSARAH.COM/JENNANDLUCAS

Thank you,

I can’t seem to be able to open the website with Firefox, as you said. The reason is simple – everything that goes after domain name in an URL is case sensitive. In other words, mydomain.com/post and mydomain.com/POST are two different links. When the URL gets copied, the domain itself is always interpreted as lower-case, but everything that follows the forwards slash is as copied. It would seem that Chrome attempts to redirect if a page is not found, while Firefox does not. I would recommend creating a new page/post with capital letters in the URL and redirect to http://www.sitesbysarah.com/jennandlucas (the original page).
A different solution is to create a duplicate page with capital letters, but that’s not really a recommended practice for more than one reason (I tend to check if I have any duplicate pages with some quick online tool, like http://webanalysis.tools , and remove/redirect those I find asap).

Thanks for your response. How do I create a page with capital letters in the URL. Won’t it just change it to lower case?

Thank
Sarahb

I don’t think you would need to create another actual uppercase file to do the redirect. A “permanently moved” in htaccess should work.

1 Like

One thing to bear in mind if you are developing on a windows pc with something like xampp or wamp it is not case sensitive which can catch you out!

Can you explain how to do this??

Thanks

Being WordPress, I assume RewriteEngine is already on.

Important! Errors in htaccess files can crash your site, keep a working backup file

In its simplest, there will be a rewrite condition and a rewrite rule (when this, do this)

https://httpd.apache.org/docs/2.4/mod/mod_rewrite.html#page-header

Under RewriteCond Directive there is

Syntax: RewriteCond TestString CondPattern [flags]

There are many "TestString"s but I think REQUEST_URI would work here.

The “CondPattern” could simply be the uppercase name.

In this use case you want to not use the optional [NC] (no case) flag. It would create an endless loop and cause a server error.

Thus far

RewriteCond {REQUEST_URI} JENNANDLUCAS

Under RewriteRule Directive there is

Syntax: RewriteRule Pattern Substitution [flags]

“Pattern” can be very complex regex, but in this case I think it can be relatively simple

“Substitution” will be what you want to use, i.e. the lowercase

“Flag” could be [R=301] (redirect moved permanently)

So this should work

RewriteCond {REQUEST_URI} JENNANDLUCAS 
RewriteRule ^/JENNANDLUCAS(.)* /jennandlucas$1 [R=301] 

Untested and I might be missing something, but you can give it a try. Just be prepared to revert to your backup file if you need to.

I was not sure how savvy you are when it comes to programming, Sarah, but if it’s possible, what Mittineague said.
The easiest alternative if you’d prefer not to touch the code is still to just send out a second notice with the proper URL and highlighting it should be in lowercase, and noting that those who’ve already rspv’d should ignore the request.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.