I've looked everywhere for an htaccess rule that can rewrite a url from:
customer.com/it/public/ to customer.com/it/
My folder structure is like this:
/customer.com .htaccess |-- it |-- .htaccess |-- public | |-- .htaccess Inside the root of the website, is a Codeigniter app, and inside the IT folder, there is a Laravel app.
This is my current HTACCESS in the root of my website (rewrites the codeigniter index.php):
<IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .* index.php/$0 [PT,L] </IfModule> These are the rules in my HTACCESS file in the root of the IT folder (supposed to rewrite laravel public folder):
<IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_URI} !^public/ RewriteRule ^(.*)$ /public/$1 [L] </IfModule> And these are the rules inside the HTACCESS file in the Public folder (rewrites the index.php inside the public folder):
<IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews </IfModule> RewriteEngine On # Redirect Trailing Slashes... RewriteRule ^(.*)/$ /$1 [L,R=301] # Handle Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] </IfModule> Portion of the debug:
DOCUMENT_ROOT C:/xampp/htdocs REQUEST_SCHEME http CONTEXT_PREFIX CONTEXT_DOCUMENT_ROOT C:/xampp/htdocs SERVER_ADMIN postmaster@localhost SCRIPT_FILENAME C:/xampp/htdocs/it/public/index.php REMOTE_PORT 44461 REDIRECT_URL /it/ GATEWAY_INTERFACE CGI/1.1 SERVER_PROTOCOL HTTP/1.1 REQUEST_METHOD GET QUERY_STRING REQUEST_URI /it/ SCRIPT_NAME /it/public/index.php PHP_SELF /it/public/index.php REQUEST_TIME_FLOAT 1395338241.106 REQUEST_TIME 1395338241