Htaccess File

sanjaykrsingh/vyom/api/backend/web/.htaccess

ENV, GET, POST, PUT, REQUEST_FILENAME, REQUEST_URI, X-Requested-With
# For production, put your rewrite rules directly into your VirtualHost
# directive and turn off AllowOverride.

<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteCond %{REQUEST_FILENAME} -s [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ - [NC,L]

    RewriteCond %{REQUEST_URI}::$1 ^(/.+)(.+)::2$
    RewriteRule ^(.*) - [E=BASE:%1]
    RewriteRule ^(.*)$ %{ENV:BASE}index.php [NC,L]

</IfModule>

# CORS Headers (add this)
<ifModule mod_headers.c>
    Header always set Access-Control-Allow-Origin: "*"
    Header always set Access-Control-Allow-Methods "POST, GET, PUT, DELETE, OPTIONS"
    Header always set Access-Control-Allow-Headers "X-Requested-With, content-type, x-auth-token, x-auth-id"
</ifModule>
Exit mobile version