Answer the question
In order to leave comments, you need to log in
How to change the index file?
Good day, how to change the index file in another folder /public/index.php
so that when you go to the site there is no error 403
www.yoursite.com so that it opens like this, and not like www.yoursite.com/public
read what you can through. htaccess
in the public folder, it is there, but I don’t know how to write it
here. Here is the .htaccess code
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect index.php to /
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>
Answer the question
In order to leave comments, you need to log in
The question is not very clear. As far as I understand, you need to change the site's root directory from www.yoursite.com/public to www.yoursite.com. You can do it in .htaccess like this:
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/(public)
RewriteRule (.*) /public/$1
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /public/index.php
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question