Skip to main content
deleted 15 characters in body
Source Link
TylerH
  • 21.3k
  • 84
  • 84
  • 121

Just create .htaccess file at root and add these lines to it

<IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^(.*)$ public/$1 [L] </IfModule> 

That's it!

The above code works on the root public_html folder. Having said that your core laravel file should be inside the public_html folder, if your directory looks like public_html/laravelapp/public and if you put the above code inside laravelapp it won't work. Therefore you must copy all your core files into public_html and put the .htaccess file there  .

If you want to keep the code in a subdirectory then you can create a subdomain then this code will work for that also.

Just create .htaccess file at root and add these lines to it

<IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^(.*)$ public/$1 [L] </IfModule> 

That's it!

The above code works on the root public_html folder. Having said that your core laravel file should be inside the public_html folder, if your directory looks like public_html/laravelapp/public and if you put the above code inside laravelapp it won't work. Therefore you must copy all your core files into public_html and put the .htaccess file there  .

If you want to keep the code in a subdirectory then you can create a subdomain then this code will work for that also.

Just create .htaccess file at root and add these lines to it

<IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^(.*)$ public/$1 [L] </IfModule> 

The above code works on the root public_html folder. Having said that your core laravel file should be inside the public_html folder, if your directory looks like public_html/laravelapp/public and if you put the above code inside laravelapp it won't work. Therefore you must copy all your core files into public_html and put the .htaccess file there.

If you want to keep the code in a subdirectory then you can create a subdomain then this code will work for that also.

added 477 characters in body
Source Link

Just create .htaccess file at root and add these lines to it

<IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^(.*)$ public/$1 [L] </IfModule> 

That's it!

The above code works on the root public_html folder. Having said that your core laravel file should be inside the public_html folder, if your directory looks like public_html/laravelapp/public and if you put the above code inside laravelapp it won't work. Therefore you must copy all your core files into public_html and put the .htaccess file there .

If you want to keep the code in a subdirectory then you can create a subdomain then this code will work for that also.

Just create .htaccess file at root and add these lines to it

<IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^(.*)$ public/$1 [L] </IfModule> 

That's it!

Just create .htaccess file at root and add these lines to it

<IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^(.*)$ public/$1 [L] </IfModule> 

That's it!

The above code works on the root public_html folder. Having said that your core laravel file should be inside the public_html folder, if your directory looks like public_html/laravelapp/public and if you put the above code inside laravelapp it won't work. Therefore you must copy all your core files into public_html and put the .htaccess file there .

If you want to keep the code in a subdirectory then you can create a subdomain then this code will work for that also.

Source Link

Just create .htaccess file at root and add these lines to it

<IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^(.*)$ public/$1 [L] </IfModule> 

That's it!