-1

I have my Laravel 4 core files uploaded in a folder call "laravel" and uploaded the contents from public folder to www folder.

After some configuration with the path, the webpage was able to load but with a ".php" extension to it.

Any ways I can fix it with the .htaccess file?

despicable me
  • 63
  • 1
  • 10

1 Answers1

0

Have a look at this question and this question.

Here's a sample .htaccess file that can handle PHP scripts without the trailing .php extension:

RewriteEngine on

#unless directory, remove trailing slash
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ $1 [R=301,L]

#redirect external .php requests to extensionless url
RewriteCond %{THE_REQUEST} ^(.*)\.php([#?][^\ ]*)?\ HTTP/
RewriteRule ^(.*)\.php$ $1 [R=301,L]

#resolve .php file for extensionless php urls
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php [L]
Community
  • 1
  • 1
Filippos Karapetis
  • 4,367
  • 21
  • 39