skip to Main Content

I want to rewrite my URL for URL incase sensivity i.e. to convert url tolowercase

(eg. www.MywebsIte.Com/Abc should be redirected to
www.mywebsitename.com/abc
)

I have found may suggestion but all keep on giving me server 500 error refer code below:

<IfModule mod_rewrite.c>

  RewriteEngine on
  RewriteCond %{HTTP_HOST} !^www.
  RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
  RewriteCond %{HTTPS} off 
  RewriteCond %{HTTPS_HOST} !^www.mywebsitename.com$ [NC]
  RewriteRule ^(.*)$ https://www.mywebsitename.com/$1 [L,R=301]

  RewriteBase /
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

The above code works perfectly fine.
Need to add code/rule for URL case insensitive.

2

Answers


  1. Chosen as BEST ANSWER

    I have referred the link below and it working...

    Refer [link]:(rewrite uppercase url to lowercase url htaccess).


  2. Add this rule in your htaccess

    CheckCaseOnly On
    

    This will affect all levels in the URL, for example http://localhost/ExAmPle/someFILE would be fixed to http://localhost/example/someFile

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search