1

So my problem is that when I access www.my-website.com I land on the page related to var/www/html instead of my actual website directory var/www/html/mywebsite.

How can I change that please ? I'm using LAMP on Ubuntu 16.04 LTS.

Thank you in advance. EDIT: I'm using a MYBB forum, changing DocumentRoot is but a glitch in this case, as it does makes my landing page the right one, but it loses all php code and links / button links since they refer to www.my-website.com/landingpage which becomes inexistant after it became www.my-website.com

MoodyW
  • 23

2 Answers2

1

This answer assumes you did not change the default settings of the apache server before.

First change the /etc/apache2/apache2.conf, edit the following lines:

<Directory /var/www/html/>
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>

to

<Directory /var/www/html/mywebsite/>
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>

then edit /etc/apache2/sites-available/000-default.conf and change the following line

DocumentRoot /var/www/html

to

DocumentRoot /var/www/html/mywebsite

Easier however would be to simply copy the contents of /var/www/html/mywebsite to /var/www/html

Videonauth
  • 33,815
0

Ok I found the answer:

1- Leave DocumentRoot pointing at /var/www/html

2- Move your mybb forum from /var/www/html/yourforum to /var/www/html

3- Open settings.php file vi /var/www/html/inc/settings.php

4- find $settings['bburl'] line and set it to your website new url:

$settings['bburl'] = "http://www.mywebsite.com/";

5-find $settings['cookiedomain'] and set it to this:

$settings['cookiedomain'] = ".mywebsite.com";

6- find $settings['cookiepath'] and set it to "" if your directory is var/www/html otherwise set it to "yourforum" if your directory is var/www/html/yourforum

$settings['cookiepath'] = "";

7- go to your mybb admin cPanel: Configuration>Setting>Site Details and change the settings to the same thing.

MoodyW
  • 23