How to redirect your laravel e-commerce project from the /public folder to the main domain?

Updated 30 April 2024

To redirect your laravel e-commerce project from the /public folder to the main domain, after you are done setting up your laravel e-commerce project, major roadblock comes in redirecting the laravel e-commerce project from /public folder to the main domain so as to make it easily accessible to the general public and become SEO friendly.

Redirect Laravel e-commerce project from the /public folder to the main domain

You can follow the below steps to successfully redirect your laravel e-commerce project from /public folder to the main domain.

Hostings having Root Access

Below we have mentioned steps that can be followed for those who are either using dedicated hosting or VPS in which they have permission for root access so as to make the changes.

Step 1

Once you have successfully installed Bagisto, it will appear something like this. Below I am giving the example in which I have installed Bagisto on my local directory.

Step 2

If you are using Apache server, you need to go into your system files at the following path:

You will get a configuration file named as 000-default.conf (the file name can vary).

Apache Config Files

Step 3

Open the as said file above and add the following at the end of the document.

Change the following parameters as for your settings

After you have saved the configuration, just restart your Apache service again.

Step 4

Next, open the .env file which is there in your Bagisto directory and make the below changes.

APP_URL: You need to change the already existing path to the primary domain which you want to point.


Once the configuration has been done, the bagisto front-end will appear on the domain that has been provided by you.

For Shared Hostings

Below we have mentioned steps which you can follow if you are using shared hosting or something similar in which you don’t have the root access to do the changes.

Step 1

Find the .htaccess file inside the public_html(root directory of your primary domain). If the file is not there, you can create a new file from File Manager, named .htaccess.

Open the .htaccess file and add the following code

Save the file and clear your browser cache to look for the changes.

. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


  • Nhut
    • saurav pathak (Moderator)
  • Nakib Imrul Hasan
    • saurav pathak (Moderator)
      • Farhan
        • saurav pathak (Moderator)
  • Biru kunwar
    • Prachi Chauhan (Moderator)
  • zakir khan
    • Prachi Chauhan (Moderator)
  • TWilson
    • saurav pathak (Moderator)
  • Anik
    • saurav pathak (Moderator)
  • Start a Project

      Message Sent!

      If you have more details or questions, you can reply to the received confirmation email.

      Back to Home