htaccess的内部重定向不工作的子文件夹 [英] .htaccess internal redirect not working for subfolder

查看:210
本文介绍了htaccess的内部重定向不工作的子文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网站,有它在另一个网站的子文件夹中。例如, www.domain.com 和子文件夹将 www.domain.com/uk / 。它们都包含重复的文件,所以即使是的.htaccess 文件是一样的。现在的问题是,当我重​​定向到的.htaccess 用户英国子文件夹里面的文件在其重定向的同一目录他们在父站点具有重复名称的文件。

I have a site that has another site inside of it in a sub folder. For example, www.domain.com and the sub folder would be www.domain.com/uk/. They both contain duplicate files, so even the .htaccess file is same. Now the problem is when I redirect users through .htaccess inside the uk subfolder to a file in the same directory it redirects them to the file in the parent site with the duplicate name.

这是我用我的.htaccess文件中的规则:

This is the rule I have used in my .htaccess file:

RewriteRule ^category/[a-zA-Z0-9_-]+/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/$ final_final.php 

我没有与mod_rewrite的很多经验。

I don't have much experience with mod_rewrite.

推荐答案

在父目录的RewriteBase /

RewriteEngine On
RewriteBase /

在子目录中的的RewriteBase /英国

RewriteEngine On
RewriteBase /uk

这篇关于htaccess的内部重定向不工作的子文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆