You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by sn...@cob.org on 2006/09/20 00:56:50 UTC

[users@httpd] Keywords and apache

Can anyone point me to the best directive to use for keyword redirection.
What we're looking to do is allow visitors to our site to type in say
http://www.mydomain.com/keyword and have them be redirected to
http://www.mydomain.com/keyword/ and then let Apache pick up the default
file index.htm so that it results in the visitor be sent to
http://www.mydomain.com/keyword/index.htm.  Another example would be
redirecting http://www.mdomain.com/keyword to
http://www.mydomain.com/department/services/keyword/index.htm

I tried the redirect directive but can't seem to get it to work.  Here's
what I tried:

Redirect permanent /pw http://www.cob.org/pw/

Any help appreciated...I'll be sure to pay it forward.

Thanks.
____________________________
Steven Niedermeyer
Bellingham, WA


---------------------------------------------------------------------
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


Re: [users@httpd] Keywords and apache

Posted by Joshua Slive <jo...@slive.ca>.
On 9/26/06, Qingshan Xie <xi...@yahoo.com> wrote:
> Joshua,
>
> Sorry for late question.
> I thought mod_dir will append this trailing-slash but
> seems Apache core can also do it.  what is the
> relation of mod_dir and Apache core for this
> trailing-slash redirect handling?

As far as I know, apache does not do trailing-slash redirects unless
mod_dir is present.

Joshua.

---------------------------------------------------------------------
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


Re: [users@httpd] Keywords and apache

Posted by Joshua Slive <jo...@slive.ca>.
On 9/19/06, sniedermeyer@cob.org <sn...@cob.org> wrote:

> So when I type in www.mydomain.com/keyword   the browser delivers
> www.mydomain.com/keyword/index.htm, however, the address bar in the browser
> only shows www.mydomain.com/keyword

I doubt that.  It probably shows http://www.mydomain.com/keyword/
(note the trailing slash).  This is usually what is desired.  The
index.htm is considered an implimentation detail that is better hidden
from the client.  If you really want this, then redirect directly to
it:
Redirect permanent /keyword http://www.mydomain.com/keyword/index.htm

Joshua.

---------------------------------------------------------------------
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


Re: [users@httpd] Keywords and apache

Posted by Qingshan Xie <xi...@yahoo.com>.
Joshua,  

Sorry for late question. 
I thought mod_dir will append this trailing-slash but
seems Apache core can also do it.  what is the
relation of mod_dir and Apache core for this
trailing-slash redirect handling? 

Thx, Q.Xie

--- Joshua Slive <jo...@slive.ca> wrote:
......
> This is called a trailing-slash redirect, and should
> happen automatically if you have "UseCanonicalName
off". 
> Then the index.html should be delivered
automatically if DirectoryIndex
> is set correctly.
> If that isn't working, tell us exactly what is
> happening including the
> contents of the error and access logs for the
> request.
> 
> For the second example, you need something like
> Redirect permanent /keyword
> http://www.mydomain.com/department/services/keyword/
> 
> Joshua.
> 
>
---------------------------------------------------------------------
> 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
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
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


Re: [users@httpd] Keywords and apache

Posted by sn...@cob.org.
It appears to be serving up the correct page, but the full URL isn't
showing.  I tried adding the "UseCanonicalName off" and it didn't appear to
affect anything.

So when I type in www.mydomain.com/keyword   the browser delivers
www.mydomain.com/keyword/index.htm, however, the address bar in the browser
only shows www.mydomain.com/keyword

When I type in www.mydomain.com the browser delivers
www.mydomain.com/index.htm and the address bar in the browser shows
www.mydomain.com/index.htm (this is what I'm trying to accomplish with the
keywords).

I made sure the dir module is loaded as well.

Here's what the access log shows when I try to pull up
www.mydomain.com/keyword

XXX.XXX.XXX.XXX - - [19/Sep/2006:16:43:20 -0700] "GET /keyword HTTP/1.1"
200 6942 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.4)
Gecko/20060508 Firefox/1.5.0.4"

Based on your comment about the trailing slash.  I found documentation
pointing to the need to have the following directive:

DirectorySlash On

I added this and it didn't appear to fix this issue either, although it
sounded like it was supposed to address it.

My DirectoryIndex is set as follows:

<IfModule dir_module>
    DirectoryIndex index.html index.htm default.htm default.html
</IfModule>


____________________________
Steven Niedermeyer
Bellingham, WA





                                                                           
             "Joshua Slive"                                                
             <jo...@slive.ca>                                             
             Sent by:                                                   To 
             jslive@gmail.com          users@httpd.apache.org              
                                                                        cc 
                                                                           
             09/19/2006 04:19                                      Subject 
             PM                        Re: [users@httpd] Keywords and      
                                       apache                              
                                                                           
             Please respond to                                             
             users@httpd.apach                                             
                   e.org                                                   
                                                                           
                                                                           




On 9/19/06, sniedermeyer@cob.org <sn...@cob.org> wrote:
> Can anyone point me to the best directive to use for keyword redirection.
> What we're looking to do is allow visitors to our site to type in say
> http://www.mydomain.com/keyword and have them be redirected to
> http://www.mydomain.com/keyword/ and then let Apache pick up the default
> file index.htm so that it results in the visitor be sent to
> http://www.mydomain.com/keyword/index.htm.  Another example would be
> redirecting http://www.mdomain.com/keyword to
> http://www.mydomain.com/department/services/keyword/index.htm
>
> I tried the redirect directive but can't seem to get it to work.  Here's
> what I tried:
>
> Redirect permanent /pw http://www.cob.org/pw/

This is called a trailing-slash redirect, and should happen
automatically if you have "UseCanonicalName off".  Then the index.html
should be delivered automatically if DirectoryIndex is set correctly.
If that isn't working, tell us exactly what is happening including the
contents of the error and access logs for the request.

For the second example, you need something like
Redirect permanent /keyword
http://www.mydomain.com/department/services/keyword/

Joshua.

---------------------------------------------------------------------
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


Re: [users@httpd] Keywords and apache

Posted by Joshua Slive <jo...@slive.ca>.
On 9/19/06, sniedermeyer@cob.org <sn...@cob.org> wrote:
> Can anyone point me to the best directive to use for keyword redirection.
> What we're looking to do is allow visitors to our site to type in say
> http://www.mydomain.com/keyword and have them be redirected to
> http://www.mydomain.com/keyword/ and then let Apache pick up the default
> file index.htm so that it results in the visitor be sent to
> http://www.mydomain.com/keyword/index.htm.  Another example would be
> redirecting http://www.mdomain.com/keyword to
> http://www.mydomain.com/department/services/keyword/index.htm
>
> I tried the redirect directive but can't seem to get it to work.  Here's
> what I tried:
>
> Redirect permanent /pw http://www.cob.org/pw/

This is called a trailing-slash redirect, and should happen
automatically if you have "UseCanonicalName off".  Then the index.html
should be delivered automatically if DirectoryIndex is set correctly.
If that isn't working, tell us exactly what is happening including the
contents of the error and access logs for the request.

For the second example, you need something like
Redirect permanent /keyword http://www.mydomain.com/department/services/keyword/

Joshua.

---------------------------------------------------------------------
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