删除部分网址

发布于 2024-09-10 05:53:42 字数 528 浏览 2 评论 0原文

我有一个像这样的网址http://example.com/blog/photos/photos/gallery/image/1

我需要删除第二个照片文件夹。如何使用 mod_rewrite.htaccess 删除该部分?

为了您的兴趣,/blog 是我的文档根目录。

非常感谢您的任何建议,史蒂夫

编辑

您应该知道 URL 是由 Wordpress 3.0 和 NextgenGallery 生成的。

http://example.com/blog 是我的文档根目录。这意味着我已将 Wordpress 安装到文件夹 blog 中。

blog 之后的第一个 slug 是我与画廊关联的页面。

第二个slug是专辑的名称,可以重命名为您想要的任何内容。它只是我的画廊的占位符。 gallery 是画廊的名称。

i have a url like this http://example.com/blog/photos/photos/gallery/image/1.

And i need to remove the second photos folder. How do i remove the part using mod_rewrite and .htaccess?

For your interest /blog is my document root.

Thanks a lot for any suggestions, Steve

EDIT

You should know that the URLs being generated by Wordpress 3.0 und NextgenGallery.

http://example.com/blog is my document root. That means i have installed Wordpress into the folder blog.

The first slug after blog is the page i have my gallery associated with.

The second slug is the name of the album and could be renamed to everything you want. It is just a placeholder for my galleries. gallery is the name of the gallery.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不爱素颜 2024-09-17 05:53:42

假设您想要进行重定向:

RewriteRule ^/blog/photos/photos/(.*)$ /blog/photos/$1 [R]

Assuming you want to do a redirect:

RewriteRule ^/blog/photos/photos/(.*)$ /blog/photos/$1 [R]
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文