1
I created a virtual host using apache, the problem is that I can access the site on my "localhost" as follows:
site.com
To access my site on localhost in this way I did the following in the file "/etc/hosts":
127.0.0.1 site.com
And I made a setup in apache to access my site on 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 cannot access my routes using the virtual apache host example:
site.com/usuarios
site.com/v1.0/usuarios
Anyway I can’t access any route(Uri), how can I solve this ?
I have a folder with several projects I made a . htaccess in it to not let anyone see my directory structure that way:
.htaccess Folder "Project":
Options -Indexes
IndexIgnore *
Now inside this project folder I have another folder called "site.com" which is the project that I can’t access any Ri, inside it I have a folder called "public_html" which has another file . htaccess and an index.php file, the . htaccess file is thus:
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]
See what my directory structure looks like:
projeto
.htaccess
site.com
public_html
.htaccess
I know that what I apply to a . htaccess in the higher folders is also applied to the subfolder, will there be something wrong in the . haccess that were created in these two folders ? or is my virtual host configuration incorrect?
how’s your file
.htaccess
? Ask him the question too.– NoobSaibot
I edited the question put as this my file . htacces, and also put my directory structure.
– Lucas Lima
Inside the directory
site.com
has the directorypublic_html
?– NoobSaibot
Have yes I’m sorry, I’ll edit the question again, but I’ve changed the directory structure.
– Lucas Lima
check the access permissions of directories
– NoobSaibot
error when you access Urls?
– NoobSaibot
Yes gives an error: 404 Not Found, the funny thing is that I did the same thing in windows and gave no error, I will send to folder permissions...
– Lucas Lima
-rwxr-Xr-x 1 dev dev 313 Sep 14 12:11 . htaccess, all other files including my folders are with that same permission there.
– Lucas Lima