httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bagus" <ba...@cox.net>
Subject RE: [users@httpd] mod_rewrite questions?
Date Thu, 18 Nov 2004 14:16:17 GMT
Thanks Peter,

It doesn't seem so. I get a 404.

I'll admit I had some help installing this particular version of apache. The
box is a older version of FreeBsd. At the time is was one of the first to
support SCSI II. FreeBSD 2.2CAM-19980716-SNAP. Apache has been compiled with
JServ-1.0b3.

So again, do y'all think that therefore... mod_rewrite is not compiled into
my version of apache and therefore I should try to reconfigure my version
and recompile it to get mod_rewrite functionality?

Thanks.

Bagus...

bagus2> lynx http://127.0.0.1/server-info

                                  Not Found

   The requested URL /server-info was not found on this server.
     _________________________________________________________________


    Apache/1.3.6 Server at www.bagus.org Port 80


-----Original Message-----
From: Peter Johnson [mailto:peter@wizardslair.net]
Sent: Sunday, November 14, 2004 4:25 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] mod_rewrite questions?


Bagus,

Have you got server-info configured? (search through the config for it,
generally is restricted to localhost access only)

If you do, you should be able to browse to http://127.0.0.1/server-info
(from the machine) and it will show you which modules it has already loaded.

How did you install Apache before? What OS is it running on?

PJ

Bagus wrote:
Thanks Peter and Tim.

hmm...

I'm not sure what's happening now...I've never loaded modules before.

I'm not sure if I have the mod_rewrite module in my binary. I'm running
1.3.6 but under Apache-JServ-1.0b3, so I guess it is, but all indications
are that it isn't.
When I tried Peter's suggestion of

LoadModule rewrite_module
/usr/ports/distfiles/apache_1.3.4/src/modules/standard/mod_rewrite.so
AddModule mod_rewrite.c

apachectl configtest Gives: Invalid command 'LoadModule', perhaps
mis-spelled or defined by a module not included in the server configuration

Hmm.

Do you think that I'll have to recompile apache to add the module? Is there
something else wrong? Is there a better way to check if the module is
available? If I do have to recompile, what files do I edit to make this
happen?

Thanks, oh and btw,

the goal is only to move someone from the root to the subdirectory. Well
it's kind of to force them into that subdirectory. So if the requested url
was www.neworleansultimate.org/whatever/the/heck.html that should be
rewritten to www.neworleansultimate.org/ultimate/  if the url is
http://www.neworleansultimate.org/ultimate/index.gsp?dA=1681 it should be
left as it is.

the reason to parse .html files is that then I don't have to name every file
on my site .shtml. On most sites I create, every file has ssi's in them.
Changing that config line is usually the first thing I ask a webmaster to do
when I'm starting to build a site on another server. Nobody really wants to
have to name files .shtml. All the content producers would forget about it,
so it's just much easier to server parse everything. I've done it on sites
that are 30,000 pages of html and are getting more than 2,000,000 page views
per day without any performance problems. I highly recommend it and got it
from Behlendorf himself many years ago (how about January '95?).

Bagus


-----Original Message-----
From: Tim Burden [mailto:Tim@Burden.ca]
Sent: Thursday, November 11, 2004 9:11 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] mod_rewrite questions?


AddModule and LoadModule don't have a space in them. Neither does
RewriteRule. And you still need RewriteEngine On

----- Original Message -----
From: "Bagus" <bagus@cox.net>
To: <users@httpd.apache.org>
Sent: Thursday, November 11, 2004 10:08 PM
Subject: RE: [users@httpd] mod_rewrite questions?



Thanks Peter,

I'm not sure where the AddModule and LoadModule lines would go. In
httpd.conf? Apache doesn't seem to like them there:

Also, as for your syntax, there's no space between Rewrite and Rule, is
there? And why the space after the first dollar sign?

Thanks, what I tried is below. Any help is greatly appreciated.

Bagus

httpd.conf:

Load Module mod_rewrite
Add Module mod_rewrite

<VirtualHost 204.251.1.186>
ServerAdmin bagus@bagus.org
DocumentRoot /www/htdocs/
ServerName www.neworleansultimate.org
ServerAlias neworleansultimate.org www
DirectoryIndex index.html index.cgi index.gsp index.stm
ErrorLog /usr/local/apache/var/log/www.neworleansultimate-error_log
TransferLog /usr/local/apache/var/log/www.neworleansultimate-access_log
RewriteCond %{HTTP_HOST} ^www.neworleansultimate.org$
RewriteRule ^(.*)$                   /ultimate$1
AddType text/html .shtml
AddType text/html .html
AddType text/html .stm
AddHandler server-parsed .stm .html
ApJServMount /servlets /www
</VirtualHost>

bagus2> /usr/local/apache/sbin/apachectl configtest
Syntax error on line 231 of /usr/local/apache/conf/httpd.conf:
Invalid command 'Load', perhaps mis-spelled or defined by a module not
included in the server configuration



-----Original Message-----
From: Peter Johnson [mailto:peter@wizardslair.net]
Sent: Thursday, November 11, 2004 5:38 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] mod_rewrite questions?


Hi Bagus,

Mod Rewrite would do the trick.

RewriteCond %{HTTP_HOST} ^www.bar.com$
Rewrite Rule ^(.*)$                   /bar$1

You need to enable the mod_rewrite module. My Apache 1.x is getting a
little rusty but you'll need to make sure that you have both an
AddModule and LoadModule line for the rewrite module.

Hope that this helps.

PJ

Bagus wrote:


Hi, hopefully this will be simple.

I have two virtual hosts pointing at the same directory root.

They are for example

http://www.foo.com and http://www.bar.com

For various resaons I want all requests to http://www.bar.com to be
redirected to http://www.bar.com/bar/

Is this a Mod Rewrite  issue?  What's the syntax that I'd use?

Also, when I try putting various configuration bits into the virtual
host directive in my httpd.conf I get errors with apachectl

configtest.

ie adding this to a virtual host

RewriteEngine on
I get:
Syntax error on line 401 of /usr/local/apache/conf/httpd.conf:
Invalid command 'RewriteEngine', perhaps mis-spelled or defined by a
module not included in the server configuration
Is there more that I have to do to get this to work?

Thanks for any help.

Bagus


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server

Project.

See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP

Server Project.

See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org




---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


--------------------------------------------------------------------- The
official User-To-User support forum of the Apache HTTP Server Project. See
for more info. To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org "
from the digest: users-digest-unsubscribe@httpd.apache.org For additional
commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message