English 中文(简体)
htaccess RewriteBase
原标题:htaccess RewriteBase

我的根基有两份名录:/dev/live

这些名录内的所有内容都有相对途径,例如<代码>/cs/type.cs或/js/home.js

我想能够改变使用网路的深层目录,以便相对途径能够成为<条码>/人/人/人式<条码/代码>等或<条码>/dev/css/上型.cs。

I have tried using the following code in .htaccess located inside the /live directory:

RewriteEngine on
RewriteBase /live/

我还利用<代码>RewriteBase /public_html/live/进行了尝试。

但是,内容路径仍然是<条码>http://domain.com/cs/上型.css。 而不是<条码>http://domain.com/live/cs/type.cs 当我看这个网站时。

是否有任何想法?

谢谢。

EDIT>> Sorry I should explain that my root htaccess has the following rules pointing towards the two directories:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{HTTP_HOST} !^www.domain.com [NC]
RewriteCond %{HTTP_HOST} ^((www.)?([a-z]+).)domain.com [NC]
RewriteRule ^((www.)?([a-z]+).)domain.us$ /live/index.php?tag=%3 [L,P]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{HTTP_HOST} !^www.domain.com [NC]
RewriteCond %{HTTP_HOST} ^dev.((www.)?([a-z]+).)domain.com [NC]
RewriteRule ^((www.)?([a-z]+).)domain.us$ /live/index.php?tag=%3 [L,P]
最佳回答

RewriteBase 请你确定如何翻译URLs,以便再次提出途径。 这并非是你重新使用它。 使用标准<代码>Rewrite Rule

RewriteCond %{REQUEST_URI} !^/live
RewriteRule ^(/?)(.*) /live/$2
问题回答

暂无回答




相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签