在服务器中移动文件夹时,更正所有链接
假设我的服务器上有一个名为 books 的文件夹。
在里面我有一个带有以下链接的index.php: 书籍/book1.php books/book2.php
然后我决定创建一个名为“scifi”的子目录,以便更好地对书籍进行排序。
所以这些书不在: 书籍/科幻/book1.php books/scifi/book2.php
链接已更改,现在 index.php 上的链接不起作用。
我怎样才能(或重定向*)所有链接而不必一一浏览。
*请不要被重定向抛弃,我并不是以编程方式(必然)而是以说明性方式表示它。
Lets say I have this folder on my server called books.
Inside I have and index.php with this links:
books/book1.php
books/book2.php
I then decide to create a subdirectory called "scifi", for a better sorting of the books.
So the books are no in:
books/scifi/book1.php
books/scifi/book2.php
The links have changed and now the links on index.php dont work.
How can I (or redirect*) all the links without having to go one by one.
*please dont be thrown away by redirect I do not mean it in the programming way (necessarily) rather in an illustrative one.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
只是为了澄清史蒂夫的回答:
这作为一堂课确实很有用,但我没有将链接定义为 php 变量,所以工作是一样的!
非常感谢你!
Just to clarify Steve´s answer:
It was really useful as a lesson but i didn´t have the links links defined as php variables so the work would be the same!
Thanks you very much!