Tell me more ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm new to server fault, but I've posted on other SE sites before, so here's my question:

This is the first time I've worked on doing a redirect. I'm using WAMP with following stack:

  • Apache 2.2.6
  • PHP 5.2.4
  • Connecting to an external test MySQL db

I currently have the following in my (WAMP) httpd.conf file:

<Directory "c:/wamp/www/customername/">
# Redirect to a URL on the same host
Redirect permanent /olddirectoryname/ /newdirectoryname/
</Directory>

I am using customername, olddirectoryname, newdirectoryname as placeholder names for the purposes of posting this question.

This did not appear to be working, so I checked the Apache access log to confirm and is indeed not redirecting. What was odd to me, was that I looked at some of the earlier entries in the access log, and I saw this line:

127.0.0.1 - - [31/Jul/2012:13:05:39 -0500] "GET /customername/olddirectory HTTP/1.1" 301 241

I'm certain the 301 was the redirect, but have no idea what 241 means. I Googled "http code 241" and had nothing relevant in my search results. This seems as if it should be a very simple process, but I'm having some first-timer issues as I work through this.

I also tried setting up a redirection with http://www.google.com/ as well, just to see if that would work, but I did not have the desired results.

I've been working from the this Apache documentation: mod_alias

Thanks, Waddler

share|improve this question
What you should look at is the documentation for apache logs, at httpd.apache.org/docs/current/logs.html . That would inform you that the last number is the number of bytes transferred. – Jenny D May 20 at 8:33

closed as off topic by Michael Hampton, Ward, Andrew, growse, Jenny D May 20 at 8:34

Questions on Server Fault are expected to relate to professional server, networking, or related infrastructure administration within the scope defined in the FAQ. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about closed questions here.

1 Answer

"241" in this context is the number of bytes transferred.

In Apache's default log, the HTTP response code appears after the URL (here, 301) followed immediately by the number of bytes in the response body (here, 241).

As for your redirect, all the documentation examples show redirects without the trailing /. So try it that way:

Redirect permanent /old /new

Also, try putting the redirect in the appropriate VirtualHost section rather than in the Directory.

share|improve this answer
That didn't move the needle for me. I wish I would have checked earlier so I would have at least had the 301 working in my favor. It still says: "GET /customername/old HTTP/1.1" 200 49561 with no indication of a redirect. I even restarted WAMP and still no dice. Is this a WAMP issue or a newbie issue? – Waddler Jul 31 '12 at 19:12
I decided to use a PHP header ('Location: ...'); call instead. Any potential drawbacks? – Waddler Jul 31 '12 at 20:03

Not the answer you're looking for? Browse other questions tagged or ask your own question.