1

I've added the following to my public/.htaccess file in my laravel project.

#### Force lower case URL ####
RewriteCond %{REQUEST_URI} ^[^A-Z]*[A-Z].*
RewriteRule ^ ${lc:%{REQUEST_URI}} [L,R=301]

It works as far as converting all upper-case characters to lower, however it reroutes the url to the public folder.

ie. /jobs gets rerouted to /public/jobs

Is there away to avoid this?

Matt Jameson
  • 582
  • 3
  • 16

1 Answers1

0

You shouldn't edit or add .htaccess file, edit index.php etc. What you should do is point web server to a public directory instead of root one.

If you're using Apache, edit these lines in a virtual host block:

DocumentRoot "C:/projects/laravel/public"
<Directory "C:/projects/laravel/public">

Restart Apache and everything will work as expected.

Alexey Mezenin
  • 158,981
  • 26
  • 290
  • 279