Home Cannot access links under the project directory in localhost (.htaccess) Ubuntu 16.04
Reply: 0

Cannot access links under the project directory in localhost (.htaccess) Ubuntu 16.04

user1154
1#
user1154 Published in April 20, 2018, 6:06 pm

Whenever I use a path in hyperlinks, form actions, etc, I can't access the root directory as being my project, it always takes me to localhost, so for example, if a try to access something like this through a hyperlink:

/home/index

I eventually get redirected to localhost, and the url becomes: localhost/home/index instead of localhost/myproject/home/index

I tried some other solutions on satckoverflow, but none of them worked out, I'm gonna list them here:

Tried to change ->

DocumentRoot /myproject/

DocumentBase /myproject/

ps: it only works if I explicitly say : /myproject/home/index, but that's not good.

I just want a solution that applies only for the current project so that I won't need to configure apache specific files every time I want to use an specific project. So I need something that has to be changed only in .htaccess in order to be more flexible!

Here's a screenshot of .htaccess, folder structure, and one of the html files where I utilize hyperlinks.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.361594 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO