Issue
I want to remove /public in the URL i want to use virtual host not changing server.php into index.php.
i'm useing webuzo admin panel i add this lines to apache config file but it seems its not working please help me what should i do
my server is centOs 7 and my project is on laravel 5.8
<VirtualHost *:80>
ServerName uptodate.pnashr.pub
ServerAdmin [email protected]
DocumentRoot /home/uptodateadmin/public_html/public
<Directory /home/uptodateadmin/public_html/public>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
Require all granted
</Directory>
</VirtualHost>
Solution
I have testing your VirtualHost config, nothing wrong with that code.
You have to make sure your public .htaccess is default from laravel and not deleted. Webuzo will already regenerate VirtualHost config everytimes we add new domain or subdomain web. So set document root from webuzo admin panel not change manually from apache config file.
Actually VirtualHost not change server.php to index.php but server.php located at parent directory and document root at subfolder public.
You can make server.php file and include "../server.php"; inside that file
Don't forget to check you .htaccess. Just use default .htaccess from laravel
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
Answered By - William Gunawan Answer Checked By - Clifford M. (WPSolving Volunteer)