How to force all the traffic to http (no ssl) on vue3 project

i have problem with sending requests to https backend. currently i'm using laravel 10 as backend and vue 3 on front.

the problem is when i deploy (production version of laravel and built of vue) on a hosting service (you can visit on eros.pacode.ir), all requests when project (front) is loading on https and if i change base url to https and visit https version (preventing mix-content) all requests status in network devtool will be (failed) with "net::ERR_CERT_COMMON_NAME_INVALID" error.

  • and if you could please give a htaccess code to redirect all traffic to http

I lunched a demo at http://eros.pacode.ir User:admin Pass:password

Feel free to investigate...

front htaccess

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /
  RewriteRule ^index\.html$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.html [L]
</IfModule>

back htaccess

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_URI} !/public
    RewriteRule ^(.*)$ public/ [L]
</IfModule>

and APP_URL in laravel .env is: http://localhost if any piece of code you need from any file (give me a small description), just add a comment.

thanks in advance :)



Comments

Popular posts from this blog

Today Walkin 14th-Sept

Spring Elasticsearch Operations

Hibernate Search - Elasticsearch with JSON manipulation