D
D
Div-Man2018-04-02 19:19:51
htaccess
Div-Man, 2018-04-02 19:19:51

How to make an entry point to the site?

You need to configure htaccess somehow.
My site opens, not directly blog.loc, but I also need to add public, like this blog.loc/public/ I set everything up using htaccess and set it up on the local host in my openserver so that the root of the site would be exactly the folder /public. Now, when I uploaded it to the hosting, the site is no longer working, how to set it up so that when you enter the site, the root folder is public?
Now I removed the setting in openserver and change htaccess.
5ac257cc2847f609680232.jpeg
fundamentally

RewriteEngine On

 
RewriteCond %{THE_REQUEST} /public/([^\s?]*) [NC]
RewriteRule ^ %1 [L,NE,R=302]
RewriteRule ^(.*)$ /public/index.php?$1 [L,QSA]

in the public folder
RewriteEngine On
RewriteBase /
 
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-l

RewriteRule ^(.*)$ index.php?$1 [L,QSA]

Now this problem has become: now the pages are loading, then there are no styles and pictures. I do not know what to do.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
ThunderCat, 2018-04-02
@ThunderCat

RewriteRule !\.(js|ico|gif|jpg|png|css|pdf|mov|mp3|woff2)$ index.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question