Welcome Guest, Not a member yet? Register   Sign In
DOCUMENT ROOT
#1

The hosting does not have access to the site configuration to change the "DOCUMENT ROOT". 
Can I get it back like it was?
In the root index.php .
What should I do?
Reply
#2

I don't fully understand. Can you share an example of how you used to do this? Most framework paths are configurable via app/Config/Paths.php, and the index.php file is controlled by app/Config/App.php and public/.htaccess - those are places to start.
Reply
#3

(06-26-2019, 05:32 AM)MGatner Wrote: I don't fully understand. Can you share an example of how you used to do this? Most framework paths are configurable via app/Config/Paths.php, and the index.php file is controlled by app/Config/App.php and public/.htaccess - those are places to start.


Attached Files Thumbnail(s)
   
Reply
#4

You are serving out the root of the project, you should be serving public/ instead.
https://codeigniter4.github.io/CodeIgnit...tml#public

Try (for example) changing this in your server config:
DocumentRoot /var/www/vhosts/dubleshop.com
to:
DocumentRoot /var/www/vhosts/dubleshop.com/public
Reply
#5

Mine is set to public_html and CI 4 fines it with no problems
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#6

(06-25-2019, 05:18 PM)fogem Wrote: The hosting does not have access to the site configuration to change the "DOCUMENT ROOT". 
Can I get it back like it was?
In the root index.php .
What should I do?

You could use a .htaccess file in the root to point to the /public/ folder

eg.
Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^yourdomain.tld$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.yourdomain.tld$
RewriteCond %{REQUEST_URI} !public/
RewriteRule (.*) /public/$1 [L]

so that when you visit yourdomain.tld it will read out of the public folder
Reply
#7

(06-28-2019, 03:57 PM)Pehesis Wrote:
(06-25-2019, 05:18 PM)fogem Wrote: The hosting does not have access to the site configuration to change the "DOCUMENT ROOT". 
Can I get it back like it was?
In the root index.php .
What should I do?

You could use a .htaccess file in the root to point to the /public/ folder

eg.
Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^yourdomain.tld$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.yourdomain.tld$
RewriteCond %{REQUEST_URI} !public/
RewriteRule (.*) /public/$1 [L]

so that when you visit yourdomain.tld it will read out of the public folder

No. No. No.

Change the hoster or ask the hoster for help.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB