cancel
Showing results for 
Search instead for 
Did you mean: 

Redirect documentroot to magento2 folder

Redirect documentroot to magento2 folder

Hi All,

 

I tried to find information on how to do this the right way but it breaks the installation. Do you have any document how I can get right of domain.com/magento2 to just be domain.com ? 

 

I tried the virtual directory like so:-

 

sudo nano /etc/apache2/sites-available/magento.conf

 

<VirtualHost *:80>
    DocumentRoot /var/www/html/magento2/pub
    <Directory /var/www/html/magento2/pub>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
    </Directory>
</VirtualHost>
sudo a2ensite magento.conf
sudo a2dissite 000-default.conf
sudo systemctl restart apache2.service

But this broke my front end but admin side work. So I reverted back. 

Does anyone have any solution?

 

Thanks in advance.

 

Javed

2 REPLIES 2

Re: Redirect documentroot to magento2 folder

Hi @ijaved,

 

Here's the documentation for Apache: http://devdocs.magento.com/guides/v2.1/install-gde/prereq/apache.html

 

Is you magento root on /var/www/html/magento2 or /var/www/html/magento2/pub (is pub the subdirectory of Magento2?).
If guess you need to remove de pub/ part on the vhost configuration.

Re: Redirect documentroot to magento2 folder

@Damian Culotta

 

I tried removing the pub too but didnt help. I basically copied over content of magento2 folder to apache root folder var/www/html and tried to run setup from there but it gets stuck at step 3 of the process. I am thinking of re-downloading from git and try again.


So far I have not found single useful document which basically tells me how to configure a domain.com type of magento installation. I read somewhere that you can add store web address but I am not sure if that will help.

 

Javed