php抓取网页(想象你想通过apache脚本配置.htacces,其余的都是相同的!)
优采云 发布时间: 2022-04-18 05:40php抓取网页(想象你想通过apache脚本配置.htacces,其余的都是相同的!)
想象一个服务器的根目录有多个别名,例如 website.nl;网站.de;使用这个物理主机直接访问 root 的根 httpdocs:
httpdocs...
httpdocsholland # webpages in Dutch (home.php | contact.php | etc)
httpdocsdeutsch # webpages in English (home.php | contact.php | etc)
httpdocsimages # all multilingual webpages share the same images
httpdocsjs_css # all multilingual webpages share the same scripts/layout
httpdocs.htaccess # here be a clean root, nothing else than .htaccess
所以只有webpage.php不同:其余的都是一样的!现在假设你想通过一个apache脚本配置.htacces来“填补根目录和文件夹之间的空白”,这样就可以在浏览器和水下输入正确的php网页,但保留较短的url在浏览器:
website.nl/home.php
//提取的文件应该来自与website.nl关联的holland文件夹
website.de/home.php
//提取的文件应该来自与website.de关联的deutsch文件夹(而不是在浏览器中看到这个:website.nl/holland/home.php | website.de/deutsch/home.php)什么apache脚本行会做这样的事情吗?非常感谢!