This is a discussion on RewriteRule and RewriteCond - Shared host within the Apache Web Server forums, part of the Web Server and Related Forums category; I'm on a shared host where the internal addresses are all: http://xxx.xxx.xxx.xxx/~user/pagename.htm ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 |
|
|||
|
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? |
|
|||
|
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 |
|
|||
|
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: > >>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 wrote:
>> 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 > Are you sure that REQUEST_URL is what you should be using? I don't find that particular variable in my references. Jim |
|
|||
|
On Tue, 11 Jul 2006 12:15:15 -0400, Jim Hayter
<see.reply.to@nowhere.invalid> wrote: >anon wrote: >>> 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 >> > >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_...onder.co.uk%3E Thanks for the response. |
|
|||
|
anon wrote:
> On Tue, 11 Jul 2006 12:15:15 -0400, Jim Hayter > <see.reply.to@nowhere.invalid> wrote: > >> anon wrote: >>>> 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 >>> >> >> 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_...onder.co.uk%3E Hmmz, sure it shouldn't be REQUEST_URI? From: http://httpd.apache.org/docs/2.0/mod...ml#rewritecond REQUEST_URI The resource requested in the HTTP request line. Grtz, -- Rik Wasmus |