-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove /public in URL not working if using localhost #2930
Comments
probably add .htaccess to root project with the following content:
|
Thanks for the feedback @samsonasik! What I really need is to remove Current: http://localhost/public-htaccess/public But I need to do it in a way that does not require any changes to the framework structure or the configuration of paths in the settings. When I apply the code presented in this issue to a virtual host, it works perfectly, even if the root directory configured on vhost is not But if I apply the same code using I know that via htaccess there is no way to change the root directory. In this case of localhost, the only way would be a redirect, with |
From the way your rewrite rules were written, I believe you need to set your httpd.conf to change the |
@jlamim could you verify if it related with #2965 and fixed by @Instrye at #2978 ? The .htaccess example by at @willnode at https://github.com/willnode/crm-toolkit/blob/master/api/.htaccess |
@jlamim Could you test with the latest code? Also check the links from @samsonasik above. |
This issue is too stale and no feedback have been received so far. Closing. |
During the creation of examples for my book on CI4 and tutorials to help the Brazilian community, I came across the need to configure the URL so that
/public
is not displayed without changing the default framewoprk structure.I created a
.htaccess
file at the root of the application containing the following code:When I use a virtual host (eg http://public-htaccess.test) this code in
.htaccess
works normally, but if I get the same structure of the application using localhost (http://localhost/public-htaccess ) the code does not work correctly, says that the controller was not found, as he understands that the controller ispublic-htaccess
.Could someone tell me if it is possible to do this redirection for the use case with localhost and how would it be the correct way within the framework standards?
The documentation in this regard is not clear, so if you can give me feedback on this issue, I can also supplement the documentation with this information.
OS: Win10
Apache: 2.4.41
PHP: 7.4.5
CodeIgniter: 4.0.3
P.S.: @lonnieezell and @samsonasik can you help me?
The text was updated successfully, but these errors were encountered: