1

After making required changes in httpd-vhosts.conf

and .hosts file in notepad, I'm still unable to visit my homepage when I put lsapp.dev. I am trying to learn Laravel.

I have put the screenshots:

First

enter image description here

Second

enter image description here

Nawrez
  • 3,314
  • 8
  • 28
  • 42
Avishek Sinha
  • 17
  • 1
  • 7
  • https://stackoverflow.com/questions/47735877/how-to-stop-chrome-from-redirecting-to-https – Alexey Mezenin Jan 07 '18 at 14:01
  • Possible duplicate of [Chrome prefixes local development sites with https](https://stackoverflow.com/questions/47748864/chrome-prefixes-local-development-sites-with-https) – CBroe Jan 07 '18 at 14:12
  • Possible duplicate of [How to stop Chrome from redirecting to HTTPS?](https://stackoverflow.com/questions/47735877/how-to-stop-chrome-from-redirecting-to-https) – Blasanka Jul 08 '18 at 09:43

2 Answers2

0

In your htdocs folder open up the index.php file, then you will see code snippet like this:

<?php
    if (!empty($_SERVER['HTTPS']) && ('on' == $_SERVER['HTTPS'])) {
        $uri = 'https://';
    } else {
        $uri = 'http://';
    }
    $uri .= $_SERVER['HTTP_HOST'];
    header('Location: '.$uri.'/dashboard/');
    exit;
?>

In this line: header('Location: '.$uri.'/dashboard/'); redirect localhost(you have change this to lsapp.dev) to localhost/dashboard(directory located at the htdocs). What you can do is change that your own file or folder or remove that line to stop that.

If you want to do something(display) in index.php file, also remove the exit.

like below:

<?php
    if (!empty($_SERVER['HTTPS']) && ('on' == $_SERVER['HTTPS'])) {
        $uri = 'https://';
    } else {
        $uri = 'http://';
    }
    $uri .= $_SERVER['HTTP_HOST'];
    //header('Location: '.$uri.'/dashboard/');
    //exit;
?>
Something is wrong with the XAMPP installation :-(

<?php

    echo '<br />very funny';

?>

I'm still unable to visit my homepage when I put lsapp.dev. I am trying to learn Laravel.

without .dev try something else .example or any. read more about that here.

Blasanka
  • 21,001
  • 12
  • 102
  • 104
0

just change lsapp.dev to lsapp.test in both the httpd-vhosts.conf file and the hosts file. It will work fine. The new chrome redirects all .dev -Domains to https