I created a virtual host using apache, the problem is that I can access the site in my localhost as follows:
site.com
To access my site in localhost this way I did the following in the / etc / hosts file:
127.0.0.1 site.com
And I made a configuration in apache to to access my site in localhost, the configuration is as follows:
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName site.com
ServerAlias www.site.com
DocumentRoot /var/www/site.com/public_html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
The problem is that I can not access my routes using the apache virtual host example:
site.com/usuarios
site.com/v1.0/usuarios
Finally, I can not access any route (uri), how can I resolve this?
I have a folder with several projects I made a .htaccess on it so I would not let anyone see my directory structure like this:
.htaccess "Project" folder:
Options -Indexes
IndexIgnore *
Now inside this project folder I have another folder that is called "site.com" which is the project that I can not access any uri, inside it I have a folder that is called "public_html" that has another file. htaccess and an index.php file, the .htaccess file looks like this:
RewriteEngine On
# Some hosts may require you to use the 'RewriteBase' directive.
# If you need to use the 'RewriteBase' directive, it should be the
# absolute physical path to the directory that contains this htaccess file.
#
# RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]
Here's my directory structure:
projeto
.htaccess
site.com
public_html
.htaccess
I know that what I apply in a .htaccess in the higher folders is also applied to the subfolder, is there anything wrong with the .haccess that were created in these two folders? or is it my virtual host configuration that is incorrect?