From owner-freebsd-questions@FreeBSD.ORG Fri Jul 13 19:18:18 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ED2CE106564A for ; Fri, 13 Jul 2012 19:18:18 +0000 (UTC) (envelope-from freebsd-listen@fabiankeil.de) Received: from smtprelay06.ispgateway.de (smtprelay06.ispgateway.de [80.67.31.101]) by mx1.freebsd.org (Postfix) with ESMTP id A8CDD8FC0A for ; Fri, 13 Jul 2012 19:18:18 +0000 (UTC) Received: from [78.35.148.244] (helo=fabiankeil.de) by smtprelay06.ispgateway.de with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.68) (envelope-from ) id 1SplIi-0003UI-6J; Fri, 13 Jul 2012 21:13:16 +0200 Date: Fri, 13 Jul 2012 21:12:50 +0200 From: Fabian Keil To: David Banning Message-ID: <20120713211250.0021cb76@fabiankeil.de> In-Reply-To: <20120713145137.GA53674@skytracker.ca> References: <20120713145137.GA53674@skytracker.ca> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/7tQ2uWLB3ngbRdbydgwJsVm"; protocol="application/pgp-signature" X-Df-Sender: Nzc1MDY3 Cc: freebsd-questions@freebsd.org Subject: Re: mod_rewrite problem with tilde X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-questions@freebsd.org List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jul 2012 19:18:19 -0000 --Sig_/7tQ2uWLB3ngbRdbydgwJsVm Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable David Banning wrote: > I am migrating to a new server location which right now > has no domain name, so the ip address is being used. > The ISP gives an address for the apache directory like so; >=20 > http://184.154.230.2/~smartst2/ >=20 > A simple redirect works, such as this one which directs to another > site; >=20 > Options +FollowSymLinks > rewriteEngine on > rewriteRule ^test\.html$ http://www.somesite.com/index.php [R=3D301,L] > > but a redirect within the site does not work. I wonder if it has to=20 > do with the tilde ~ character that the ISP has configured. >=20 > I presently have the following .htaccess; >=20 > RewriteEngine on > RewriteCond %{REQUEST_FILENAME} !-f > RewriteCond %{REQUEST_FILENAME} !-d > RewriteCond %{REQUEST_FILENAME} !-l > RewriteRule ^[^/]*\.php$ / > RewriteRule ^[^/]*\.html$ index.php >=20 > Which does not work. If anyone is aware of problems using=20 > mod_rewrite with the ~ character or could contribute any pointers > as to how I could gain more information on - for instance -where- > mod_rewrite is -attempting- to redirect (considering my above=20 > .htaccess.=20 If you access your server with "curl -v" it will show you were the response redirects to (if you get a redirect at all). Checking the Apache logs would be another option, but it may require fiddling with the log levels first. Without knowing the URL you use for testing it's hard to tell where the problem is, but my guess is that you are matching against a text that contains one or more slashes which your patterns don't allow. Fabian --Sig_/7tQ2uWLB3ngbRdbydgwJsVm Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlAAc0sACgkQBYqIVf93VJ3SgACfWUPBaVkgBGDy2I2CmHQkYivT WBIAn1NYHtUO4g5Lc4DrVMIsp+cP9yim =Axy9 -----END PGP SIGNATURE----- --Sig_/7tQ2uWLB3ngbRdbydgwJsVm--