Apache Server configuration support - RewriteRule and RewriteCond - Shared host

This is Interesting: Free IT Magazines  
Home > Archive > Apache Server configuration support > July 2006 > RewriteRule and RewriteCond - Shared host





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author RewriteRule and RewriteCond - Shared host
anon

2006-07-02, 1:48 pm

I'm on a shared host where the internal addresses are all:

http://xxx.xxx.xxx.xxx/~user/pagename.htm

At some point, I will enable DNS so that my access is:

http://www.mydomain.com/pagename.htm

But for now, in order to do testing, I need to do so through the IP
address.

I was thinking the following would work, but it doesn't:

RewriteCond %{REQUEST_URL} !^/~user/.*
RewriteCond %{REQUEST_URL} ^/xxx.xxx.xxx.xxx/.*
RewriteRule ^/xxx.xxx.xxx.xxx/(.*)$ ^/xxx.xxx.xxx.xxx/~user/$1

I was thinking that the above would just gracefully be ignored once I
enabled DNS.

Does anybody see what I'm doing wrong?

Thanks
anon

2006-07-04, 7:20 pm

On Sat, 01 Jul 2006 22:12:31 GMT, anon@anon.invalid.net (anon) wrote:

>I'm on a shared host where the internal addresses are all:
>
>http://xxx.xxx.xxx.xxx/~user/pagename.htm
>
>At some point, I will enable DNS so that my access is:
>
>http://www.mydomain.com/pagename.htm
>
>But for now, in order to do testing, I need to do so through the IP
>address.
>
>I was thinking the following would work, but it doesn't:
>
> RewriteCond %{REQUEST_URL} !^/~user/.*
> RewriteCond %{REQUEST_URL} ^/xxx.xxx.xxx.xxx/.*
> RewriteRule ^/xxx.xxx.xxx.xxx/(.*)$ ^/xxx.xxx.xxx.xxx/~user/$1
>
>I was thinking that the above would just gracefully be ignored once I
>enabled DNS.
>
>Does anybody see what I'm doing wrong?


Anybody?

anon

2006-07-10, 1:34 am

Anybody?

On Sat, 01 Jul 2006 22:12:31 GMT, anon@anon.invalid.net (anon) wrote:

>I'm on a shared host where the internal addresses are all:
>
>http://xxx.xxx.xxx.xxx/~user/pagename.htm
>
>At some point, I will enable DNS so that my access is:
>
>http://www.mydomain.com/pagename.htm
>
>But for now, in order to do testing, I need to do so through the IP
>address.
>
>I was thinking the following would work, but it doesn't:
>
> RewriteCond %{REQUEST_URL} !^/~user/.*
> RewriteCond %{REQUEST_URL} ^/xxx.xxx.xxx.xxx/.*
> RewriteRule ^/xxx.xxx.xxx.xxx/(.*)$ ^/xxx.xxx.xxx.xxx/~user/$1
>
>I was thinking that the above would just gracefully be ignored once I
>enabled DNS.
>
>Does anybody see what I'm doing wrong?
>
>Thanks


anon

2006-07-11, 8:18 am

Pretty please?

On Mon, 10 Jul 2006 03:11:08 GMT, anon@anon.invalid.net (anon) wrote:

>Anybody?
>
>On Sat, 01 Jul 2006 22:12:31 GMT, anon@anon.invalid.net (anon) wrote:
>
>


Jim Hayter

2006-07-11, 1:36 pm

anon wrote:
>


Are you sure that REQUEST_URL is what you should be using? I don't find
that particular variable in my references.

Jim
anon

2006-07-13, 1:25 pm

On Tue, 11 Jul 2006 12:15:15 -0400, Jim Hayter
<see.reply.to@nowhere.invalid> wrote:

>anon wrote:
>
>Are you sure that REQUEST_URL is what you should be using? I don't find
>that particular variable in my references.


Well, here is a link to a random post that seems to indicate it is
valid:

http://mail-archives.apache.org/mod...yonder.co.uk%3E

Thanks for the response.

Rik

2006-07-14, 1:23 am

anon wrote:
> On Tue, 11 Jul 2006 12:15:15 -0400, Jim Hayter
> <see.reply.to@nowhere.invalid> wrote:
>
>
> Well, here is a link to a random post that seems to indicate it is
> valid:
>
>

http://mail-archives.apache.org/mod...yonder.co.uk%3E

Hmmz, sure it shouldn't be REQUEST_URI?

From: http://httpd.apache.org/docs/2.0/mo...tml#rewritecond

REQUEST_URI
The resource requested in the HTTP request line.

Grtz,
--
Rik Wasmus


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2009 webservertalk.com