Question

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?

Was it helpful?

Solution

You can do it useing htaccess.

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

OTHER TIPS

Hmm... How can you imagine this? You want to open one directory and see files in another directorys?

I see two ways:

  1. Put your files from html into mediatest

  2. Setup your server to use virtualhosts and change your hosts files. For example, add mediatest.local and html.local and don't use localhost any more.

You can not navigate outside the document root.

You can make /var/www/html/ your document root and create an index file to redirect users to mediatest.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top