【问题标题】:.htaccess code for folder>subfolder>subfolder>allfiles.html (or jpg) redirect文件夹>子文件夹>子文件夹>allfiles.html(或jpg)重定向的.htaccess代码
【发布时间】:2014-03-06 21:25:08
【问题描述】:

我尝试了各种组合,但我有点疯狂地试图找出 .htaccess 代码来重定向文件夹中的所有文件>子文件夹>子文件夹>allfiles.html(或 jpg)重定向

domain.com/portfolio/fashion-beauty/pages/.

http://myportfolio.smugmug.com

这是我尝试过的最新一次,但没有运气......

Options +FollowSymlinks -MultiViews
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.primary\.com  [NC]
RewriteRule ^portfolio/fashion-beauty/pages/(.*) $ http://myportfolio.smugmug.com/$1 [R=301,NC,L]

感谢您的帮助

【问题讨论】:

标签: apache .htaccess mod-rewrite redirect subdirectory


【解决方案1】:

您的 URI 匹配正则表达式有一个小错误,请在 fotolook.com 的根 .htaccess 中尝试此代码:

Options +FollowSymlinks -MultiViews
RewriteEngine On

RewriteCond %{HTTP_HOST} ^www\.fotolook\.com$  [NC]
RewriteRule ^portfolio/(.*)$ http://christine-copeland-makeup.smugmug.com/Las-Vegas-Weddings/? [R=301,NC,L]

【讨论】:

  • primary这个词是否应该包含域名?
  • 选项 +FollowSymlinks -MultiViews RewriteEngine On RewriteCond %{HTTP_HOST} ^www\.primary\.com$ [NC] RewriteRule ^portfolio/Brides-Weddings-Events/slides/(.*)$ @ 987654321@ [R=301,NC,L]
  • 我以为是格式化的?对不起..每次我点击返回它都会提交..不确定如何在这里格式化
  • 选项 +FollowSymlinks -MultiViews RewriteEngine On RewriteCond %{HTTP_HOST} ^www\.primary\.com$ [NC] RewriteRule ^portfolio/Brides-Weddings-Events/slides/(.*)$ @ 987654322@ [R=301,NC,L] 尝试正确格式化...
  • 你需要通过编辑你的问题来放置你的代码(而不是在 cmets 中)
猜你喜欢
  • 2017-09-08
  • 2014-12-03
  • 2017-12-05
  • 2015-10-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-06-13
  • 2011-02-12
相关资源
最近更新 更多