1

I have been battling with this problem for a while. Suppose I go to website.com/one/tWo. In PHP $_SERVER['REQUEST_URI'] is one/tWo. I thought this had something to do with Apache URL rewriting so I checked .htaccess and removed everything and only left:

RewriteEngine On
RewriteRule ^one/two http://www.gosomewhereelse.com [R=301,L]

To my surprise, when trying 'one/tWo', Apache actually redirects me to www.gosomewhereelse.com.

Just to be clear, there is no redirection that happens from 'one/tWo' to 'one/two'. The URL doesn't change in the address bar and it still has the uppercase character but it's still matching with ^one/two

I tried everything I could think of and couldn't find a solution.

Niranjan N Raju
  • 12,047
  • 4
  • 22
  • 41
Nizar Gharbi
  • 51
  • 1
  • 7

2 Answers2

0

This works:

RewriteCond %{REQUEST_URI} ^/one/tWo$
RewriteRule ^(.*)$ http://www.gosomewhereelse.com [R=301,L]

This also works:

RewriteRule ^one/t[W]o http://www.gosomewhereelse.com [R=301,L]
Sergio Ivanuzzo
  • 1,820
  • 4
  • 29
  • 59
0

It turns out that it's not related to apache or PHP. The problem is from a third party software.

Nizar Gharbi
  • 51
  • 1
  • 7