Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Jul 2012 21:12:50 +0200
From:      Fabian Keil <freebsd-listen@fabiankeil.de>
To:        David Banning <david+dated+1342623098.665e12@skytracker.ca>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: mod_rewrite problem with tilde
Message-ID:  <20120713211250.0021cb76@fabiankeil.de>
In-Reply-To: <20120713145137.GA53674@skytracker.ca>
References:  <20120713145137.GA53674@skytracker.ca>

next in thread | previous in thread | raw e-mail | index | archive | help
--Sig_/7tQ2uWLB3ngbRdbydgwJsVm
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

David Banning <david+dated+1342623098.665e12@skytracker.ca> 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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120713211250.0021cb76>