I wrote a .htaccess file that redirects to the public folder on my local machine but does not on my Cpanel after being uploaded to the server.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} !/public
RewriteCond %{REQUEST_URI} !-f
RewriteCond %{REQUEST_URI} !-d
# Direct all requests to /public folder
RewriteRule ^(.*)$ /public/index.php?url=$1 [L]
</IfModule>
How do I make it redirect online on my Cpanel?
2
Answers
You don’t use an htaccess file to redirect to the public folder on local or your server. You point the domain to the /public folder.
In cpanel, when adding a domain, you specify the path to the /public folder as the path for the domain to use.
Use this into root folder
Then create another file name
server.php
Put this code into server.php