Answer the question
In order to leave comments, you need to log in
How to solve the problem with organizing a common entry point to the site?
I'm trying to make a single entry point to the site. There is such a structure:
/
-public
--index.php
.htaccess
Since this project is being built on a virtual host, I wrote the following in httpd-vhosts.conf:
<VirtualHost *:80>
DocumentRoot "d:/wamp64/www/phptest.loc/public"
ServerName phptest.loc
ErrorLog "logs/phptest.localhost-error.log"
CustomLog "logs/phptest.localhost-access.log" common
<Directory "/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
<?php
echo 'Requested URL = ' . $_SERVER['QUERY_STRING'];
AddDefaultCharset utf-8
Options -Indexes
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1 [L,QSA]
Answer the question
In order to leave comments, you need to log in
Your server should look in /Public, so htaccess should be in it.
Example (Public folder structure):
https://github.com/laravel/laravel/tree/master/public
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question