-4

While writing 'localhost' as url in the browser, the index.html at this location runs: **file:///C:/xampp/htdocs/PrepLift/html/index.php**

Generally, writing localhost as url in a browser, the index.html file saved at htdocs runs. But in my case index.html kept at other location runs.

If i want to run a index.html file kept in htdocs, what i should write as url?

let's suppose I want to run this file:///C:/xampp/htdocs/wp_blog/accesspress-lite/index.php on the browser using localhost. (This file is in some other branch folders saved in htdocs). What url should I write?

As the target file which I want to run is in the folder before the location of index.html running by localhost.

Harsh K
  • 79
  • 1
  • 7
  • 1
    I have no clue what you mean. You talk about localhost, yet you're showing file:// URI's, they're not the same. Please clarify your problem. – Oldskool Mar 23 '16 at 11:39
  • 1
    From what I understand from your question is that you need to create an virtual directory alias to your wp_blog folder to be able to access it through apache – Bart Mar 23 '16 at 11:53
  • I have edited my question, I hope it is clear now. – Harsh K Mar 24 '16 at 07:35

1 Answers1

0

Run Server and open on http protocol ... file protocol will not execute php code

You are using xampp. So run it and access it at something http://localhost/wp_blog/ ( if your port is not 80 than http://localhost:PORT_NO/wp_blog/ for example PORT_NO = 8000 than http://localhost:8000/wp_blog/

You can also run default php server like this (if php is available globally): Go to public folder -> open cmd -> Type "php -S localhost:8000"

a45b
  • 489
  • 3
  • 19
  • actually the wp_blog folder is not in the root directory. I have been using http protocol instead of file protocol. And there is no issue with the port. I think there is a need to create a virtual directory to wp_blog folder. – Harsh K Mar 24 '16 at 16:59