Mobile app version of vmapp.org
Login or Join
Goswami781

: Can Apache "Correct" URL Case? Let's say I keep every word of file names capitalized. For example, Home.php or MultipleWordTitle.html. Is there any way for Apache to redirect requests for incorrectly-cased

@Goswami781

Posted in: #Apache #Htaccess #Url #UrlRewriting

Let's say I keep every word of file names capitalized. For example, Home.php or MultipleWordTitle.html.

Is there any way for Apache to redirect requests for incorrectly-cased URLs to the capitalized pages, preferrably using .htaccess?

Simply rewriting the URL to make the first letter capitalized won't work, since some files have multiple capital letters.

Ideally, I'd like the change to be reflected on the user's side, so it would show up as MultipleWordTitle.html in his/her address bar. It's okay if that can't be done, though.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Goswami781

1 Comments

Sorted by latest first Latest Oldest Best

 

@XinRu657

There are many reasons not to ignore the all-lowercase convention but, if you believe you have a good reason for doing so, you can use Apache's mod_speling to ignore case problems in the request and then specify the canonical URL in the document itself, or issue a redirect as LazyOne described.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme