English 中文(简体)
离心器
原标题:Error with htaccess rewrite

我有一个问题,即有两套供查阅的档案,即设在达达达德。 我在同一个接待处拥有多个领域,因此,我发现并从事大量工作的利用地:

RewriteEngine On
RewriteBase /

# To redirect www.site1.com to /site1/
RewriteCond %{REQUEST_URI} !^/site1/
RewriteCond %{HTTP_HOST} ^(www.)?site1.www.
RewriteRule ^(.*)$ site1/$1 [L]

之所以如此之大,是因为它把那些人转往1.com至/site1/,而且该名录中有1号站点的网页。 事实上,这三个领域是相同的,它们的工作很出色(这套手在酒吧里藏匿)。

我的问题是,我增加一个新领域(现场2.com),是泽德的。 因此,它有自己的回旋余地,可以重写ur(以黑体字的方式通过参数)。 该公司的工程。 事实上,将BACK转至/,一带一页/index.html,任何人都无法得到。 仅通知:被zen的 app子是:

第二套带,位于/site2/www。

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

我不知道它是如何回来的。 Aren t htaccess Line relative ? 因此,它又回到了两个层次(即它位于/site2/www,而Im 带正处在/index.php(测试)上)。

最佳回答

it is not relative it respect you RewriteBase from upper level where is / ... Just put in htaccess under site2

RewriteBase /site2/
问题回答

暂无回答




相关问题
Ignore symlinks in clean URL s in .htaccess

Example URL: example.com/user /user is both a symlinked directory and a valid URL to content on my site. I user Horde Routes to request the content and all requests to the site go through index.php. ...

.htaccess File Options -Indexes on Subdirectories

I have the following .htaccess line, simple no indexes on root. Options -Indexes What do we add so it propagates to any sub directory instead of having to create one file for each? One .htaccess on ...

Mod Rewrite ignoring -d

After a day or two, I am still fighting with Mod Rewrite. It seems that 60% of my development time is spent battling the server. My current URL structure is such that all http://example.com/xyz and ...

ErrorDocument 404 Not Sending Referrer Information: PHP

I m using a standard htaccess ErrorDocument 404 to redirect users to a new page. In order to customize the 404, I need to know their referrer information (from the page they Tried to visit). $...

Find all htaccess files on server [closed]

I m looking for a Linux command to go through all the directories on my server and find all .htaccess files. The output would be a list of all those files with full path, creation/modification date ...

301 Redirect Help with Dynamic URL s and Multiple Id s

I just did a redesign for www.wildchildclothes.com which has a new URL structure. The old site ran on Zen Cart and had a bad URL structure. Here are some examples of what I want to redirect from: OLD:...

热门标签