Gitgitau
Member
- Jan 25, 2021
- 112
- 14
- 18
I am installing phpanalytics but I ended up having a /public/ after my URL. www.example.com/public/ how do I remove that? When you access the site withouth the /public/ you get a 404 error. Please help.
I guess that's where I don't get it. where do you change the web root? in .env?Read this:
phpAnalytics - Documentation - Lunatio
Documentation for the installation and configuration of phpAnalytics software.lunatio.com
3.4. Changing the public directory Important
Configure your web server's document / web root to point to the public directory of the software. For example, if you've uploaded the software in example.com folder, your web directory should be changed to example.com/public folder.
DocumentRoot "/opt/lampp/apache2/htdocs/YOURPROJECT/public"
<Directory "/opt/lampp/apache2/htdocs/YOURPROJECT/public">
<VirtualHost *:80>
DocumentRoot "YOURPROJECTROOT/public"
ServerName yourproject.local
ErrorLog "logs/yourproject-error_log"
CustomLog "logs/yourproject-access_log" common
</VirtualHost>
I am installing phpanalytics but I ended up having a /public/ after my URL. www.example.com/public/ how do I remove that? When you access the site withouth the /public/ you get a 404 error. Please help.
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/public/
RewriteRule ^(.*)$ /public/$1 [L,QSA]
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ ^$1 [N]
RewriteCond %{REQUEST_URI} (\.\w+$) [NC]
RewriteRule ^(.*)$ public/$1
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php
</IfModule>
Is there a simpler method to do this rather than using ssh puttyMaybe this will help :
Set your document root inside Apache's httpd.conf
Code:DocumentRoot "/opt/lampp/apache2/htdocs/YOURPROJECT/public" <Directory "/opt/lampp/apache2/htdocs/YOURPROJECT/public">
Or you will need to set the document root of your virtual host inside Apache's conf/extra/httpd-vhosts.conf
Code:<VirtualHost *:80> DocumentRoot "YOURPROJECTROOT/public" ServerName yourproject.local ErrorLog "logs/yourproject-error_log" CustomLog "logs/yourproject-access_log" common </VirtualHost>
worked, thank you.you need to create .htaccess and paste the code
Code:RewriteEngine On RewriteCond %{REQUEST_URI} !^/public/ RewriteRule ^(.*)$ /public/$1 [L,QSA] <IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews </IfModule> RewriteEngine On RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule .* - [e=HTTP_AUTHORIZATION:%1] RewriteCond %{REQUEST_FILENAME} -d [OR] RewriteCond %{REQUEST_FILENAME} -f RewriteRule ^ ^$1 [N] RewriteCond %{REQUEST_URI} (\.\w+$) [NC] RewriteRule ^(.*)$ public/$1 RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php </IfModule>
yes, is safe methodIs there a simpler method to do this rather than using ssh putty
worked, thank you.
Is it a safe method? Read on a forum that it's not a safe method to use. Don't even know what that means.
Thanks, that helped a lot.yes, is safe method