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

Front-end

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.

. . .

Comment

Add Your Comment

Be the first to comment.

css.php