[geeks] WWW help

Mike Meredith very at zonky.org
Sat Jun 15 07:18:27 CDT 2013


On Sat, 15 Jun 2013 01:54:05 -0400, Shannon wrote:
> My test Wordpress site on Hostmonster was set up through a redirect.
> The installer they use puts this in the .htaccess file:

Are you 100% sure it's a genuine redirect rather than a rewrite,
because :-

> <IfModule mod_rewrite.c>
>         RewriteEngine On

Without re-reading the documentation I can't be fully sure, but it
doesn't look like there's anything in those rules that would cause a
redirect rather than a rewrite. Without a URL in a RewriteRule,
mod_rewrite _should_ handle the change within the server - i.e. without
causing a redirect to make the change in the browser.

As an example, running 'lynx -head' on :-

http://visionofbritain.org.uk/location/x=3247402.69243384&y=2727008.07631233

Gives a 200 rather than a 301 or 302. And I'm pretty sure there's a
rewrite going on to add a 'location_page.jsp?" in the middle - I wrote
and tested the first draft of the rewrite rules for that site. 

If you are getting a redirect, then I think that something odd is
happening :-

1. Rewrite rules in .htaccess behave differently? A quick look doesn't
   show anything obvious in the documentation, but it's easy to miss
   something.

2. Something in the configuration is causing the redirect to take
   place. I'd go through the documentation with special regards to those
   two RewriteCond rules; the RewriteRules themselves would normally
   take an [R] to explicitly request a redirect when it wasn't normally
   required.

3. Or perhaps your hosting company has done something 'odd' to change
   the behaviour of mod_rewrite?

I could of course be totally wrong here - I'm no expert, and end up
doing stuff like this because I can read the documentation, and tinker
away on a test server until it works :)



-- 
Mike Meredith (http://zonky.org/)
--but I find her personality annoying. It's like being molested by a
  sleeping bag that speaks in Comic Sans with little love-hearts over
  the i's. -- Charles Stross


More information about the geeks mailing list