使用 htdocs 下的子目录在 XAMMP/apache 2.2 中的本地主机上添加 HTML 文件
我有一个 html 站点目录(dreamweaver CSS3),其中包含许多子目录,其中包含许多下拉菜单的 HTML 文件。 它们在原处工作得很好,但它们都有 JavaScript 菜单,并且可以保存在单独的文件中。 所以,我想使用 Include。 我不想每次想要测试包含内容时都必须将文件通过 FTP 传输到 HostGator。 我想把它放在我的本地机器上。 因此,我第一次尝试设置 XAMMP,然后在本地主机上运行我的 html 文件(站点),这样我就可以在将所有内容 ftp 到 HostGator 并将其投入使用之前看到它们的样子。
我尝试将主站点文件夹复制到 htdocs,然后将路径复制到我想要在 Firefox 中的本地主机前面运行的文件,但它给了我找不到文件: http://localhost/xampp/PL_20080923/0-Sections/ 000-ComingSoon/PHPTestComingSoonNMBT-Test.html
我的子目录是否太多? 为什么找不到该文件? 它就在那里。
也尝试过这个: http://localhost/xampp/htdocs/PL_20080923/ 0-Sections/000-ComingSoon/PHPTestComingSoonNMBT-Test.html
不行。
I have a site directory for html (dreamweaver CSS3) with lots of subdirectories that contain HTML files for a number of drop down menus. They work fine where they are, but they all have menus that are JavaScript and could be kept in a separate file. So, I want to use Include. I don't want to have to FTP my files to HostGator every time I want to test the includes. I want to have this on my local machine. So, I am attempting for the first time to setup XAMMP and then run my html files (site) on localhost, so I can see what they look like before ftping everything to HostGator and putting it live.
I tried copying the main site folder to htdocs, and then copying the path to the file I want to run in front of the localhost in Firefox, but it gave me file not found:
http://localhost/xampp/PL_20080923/0-Sections/000-ComingSoon/PHPTestComingSoonNMBT-Test.html
Do I have too many subdirectories? Why isn't the file being found? It is there.
Tried this too:
http://localhost/xampp/htdocs/PL_20080923/0-Sections/000-ComingSoon/PHPTestComingSoonNMBT-Test.html
No go.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
http://localhost/ 应该等同于 xampp/htdocs/ (即相同的文件应该可以访问,但由网络服务器提供服务。 ) 这是文档根目录。 例如,在正常的 Windows xampp 安装中 http://localhost/index.html 应该提供 c:\xampp\ htdocs\index.html。
您是否尝试过 http://localhost/PL_20080923/0-Sections/000- ComingSoon/PHPTestComingSoonNMBT-Test.html ?
http://localhost/ should be equivalent to xampp/htdocs/ (i.e. the same files should be accessible but served by the webserver.) This is the document root. So for example on a normal windows xampp installation http://localhost/index.html should serve c:\xampp\htdocs\index.html.
Did you try http://localhost/PL_20080923/0-Sections/000-ComingSoon/PHPTestComingSoonNMBT-Test.html ?