Search code examples
linuxapachedocument-root

localhost does not work unless do changes in document root


My localhost doest work till i do changes in document root. I want default Document Root to be "/var/www/html", I have directory mediatest inside /var/www/html and I want localhost should point till "/var/www/html/mediatest".

but when i set default Document Root to be "/var/www/html" localhost points till html and I need to add mediatest directory name in URL and when I change Document Root to be "/var/www/html/mediatest" it works fine but I cant use folders in html directory. How can i fix this?


Solution

  • You can do it useing htaccess.

    Add below line to your htacess: RewriteRule ^$ /abc/ [R=301,L]