Skip to content

Instantly share code, notes, and snippets.

@rraspo
Last active June 20, 2017 16:56
Show Gist options
  • Select an option

  • Save rraspo/4fa3e971178de6c838c35dc45567646c to your computer and use it in GitHub Desktop.

Select an option

Save rraspo/4fa3e971178de6c838c35dc45567646c to your computer and use it in GitHub Desktop.
Remove public/index.php from the url generated by Laravel by adding htaccess on public directory
#!/bin/bash
# Make sure httpd.conf has DocumentRoot pointing to /public/ directory
# and that access to the default document root has directive AllowOverride set to All
cat >/var/www/html/.htaccess <<EOL
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
EOL
cat /var/www/html/.htaccess
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment