Skip to content

Instantly share code, notes, and snippets.

@umidjons
Last active January 31, 2023 04:17
Show Gist options
  • Save umidjons/c2bd9a9ce0306888d458 to your computer and use it in GitHub Desktop.
Save umidjons/c2bd9a9ce0306888d458 to your computer and use it in GitHub Desktop.
Set the application root path via .htaccess

Set the application root path via .htaccess

Create .htaccess file in the application root folder.

RewriteEngine On
RewriteCond %{REQUEST_URI} !^web
RewriteRule ^(.*)$ web/$1 [L]

Also create .htaccess file in the /web/ folder:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment