Check Here
Check Here

How 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.

Bagisto Localhost

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.

Bagisto env files

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

Bagisto env file


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

Bagisto Front-end

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.

. . .

Comments (14)

Add Your Comment

  • Nhut
    How about set up sub domain for backend?
    • saurav pathak
      Hi Nhut,

      Greetings for the day!!!

      If you have installed bagisto on and redirect the public folder to point to the same, you can open the backend at

  • Nakib Imrul Hasan
    I’m using shared hosting and followed the step mentioned above but failed. Do I need anything else to edit? I’ve also tried change the .env file’s app url but nothing did happen.
    • saurav pathak
      Kindly put the document root till public in the apache config file and then restart apache. If you get any error send us the screenshot.
      • Farhan
        Dear Saurav,

        Let me know how can we access apache config file in shared hosting ?? “nakib imrul hasan” asked you aboubt shared hosting…. I am also facing same issue if you have any solution comment out….

        • saurav pathak
          Hi Farhan,

          For shared hosting I have mentioned: Find the .htaccess file inside the public_html(root directory of your primary domain) and then add code into that

  • Biru kunwar
    You mentioned above was done but domain name/admin is not found
    How to remove public path from url when project is going to live which is in shared hosting. Please help
    • Prachi Chauhan
      Hello There,

      Please reach us at our forum, here you will get guidance from our developer on the same.


  • zakir khan
    How i can enable frontend velocity theme in bagisto its always redirecting to dashboard
  • TWilson
    how can I setup 301 redirects ?
    • saurav pathak
      Hi there,

      Please once put the query on our forum so the dev can see to it and assist you:

  • Anik
    I have followed this article For Shared Hostings. I added the .htaccess file in the public_html (root directory). But when go to any page It shows me
    Internal Server Error
    The Server Encountered an internal error.

    Also if I define a route in web.php it shows me “500 | SERVER ERROR”
    What should I do now? Please help me.

  • I am using Bagisto for my website Kart Of Art and it's awesome experience with them. They have always supported with any bug asap. I recommend everyone to use this for any ecommerce website.

    Sourabh Akash

    Sourabh Akash
    Talk to Sales


    Live Chat
    Start a Project

      Message Sent!

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

      Back to Home