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

有理由怀疑有人是否能够帮助我处理下列问题。

我想把我的网址转至一个小网站,听闻只是显示一个主要灵魂的网页,使我能够在主网站上工作。

因此,我有以下法典:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain.co.uk$ [OR]
RewriteCond %{HTTP_HOST} ^www.domain.co.uk$
RewriteRule ^/?$ "http://maintenance.domain.co.uk" [R=301,L]

然而,我需要利用这一根基,才能看到我所做的工作;然而,我只想让我的IP能够看到,外部世界被转往展示主要灵魂的子宫。

我想到的是以下法典:

RewriteCond %{REMOTE_HOST} !^00.000.00.000

我会允许我这样做;然而,我仍然被转往次领域,我很想知道有人会帮助我进一步这样做。

增 编

最佳回答

最好使用<代码>%{REMOTE_ADDR}。

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?domain.co.uk$ [NC]
RewriteCond %{REMOTE_ADDR} !=00.00.00.00
RewriteRule ^/?$ http://maintenance.domain.co.uk/ [R=301,L]
问题回答

暂无回答




相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签