You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Albert Vila <av...@imente.com> on 2004/09/02 16:15:10 UTC

[users@httpd] AliasMatch problem

Hi all,

    I'm trying to find a solution to my problem using AliasMatch.

    I've got urls like /post/xxx where xxx is the post id. I want to 
redirect all calls to /post/xxx to /cgi-bin/view_post.cgi?mode=view&id=xxx.
    I think I can do that using the RedirectMatch directive, but I don't 
want to change my url, I want my url be the /post/xxx.

    Can I do that?

Thank you.

---------------------------------------------------------------------
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] AliasMatch problem

Posted by Albert Vila <av...@imente.com>.
Thanks a lot Joshua. That's great.

I've just needed to change the [PT] for [L].

Albert

Joshua Slive wrote:

>On Thu, 02 Sep 2004 16:15:10 +0200, Albert Vila <av...@imente.com> wrote:
>  
>
>>Hi all,
>>
>>    I'm trying to find a solution to my problem using AliasMatch.
>>
>>    I've got urls like /post/xxx where xxx is the post id. I want to
>>redirect all calls to /post/xxx to /cgi-bin/view_post.cgi?mode=view&id=xxx.
>>    I think I can do that using the RedirectMatch directive, but I don't
>>want to change my url, I want my url be the /post/xxx.
>>    
>>
>
>Yes, but you'll need to use mod_rewrite:
>
>RewriteEngine On
>RewriteRule ^/post/(.*) /cgi-bin/view_post.cgi?mod=view&id=$1 [PT]
>
>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] AliasMatch problem

Posted by Joshua Slive <js...@gmail.com>.
On Thu, 02 Sep 2004 16:15:10 +0200, Albert Vila <av...@imente.com> wrote:
> Hi all,
> 
>     I'm trying to find a solution to my problem using AliasMatch.
> 
>     I've got urls like /post/xxx where xxx is the post id. I want to
> redirect all calls to /post/xxx to /cgi-bin/view_post.cgi?mode=view&id=xxx.
>     I think I can do that using the RedirectMatch directive, but I don't
> want to change my url, I want my url be the /post/xxx.

Yes, but you'll need to use mod_rewrite:

RewriteEngine On
RewriteRule ^/post/(.*) /cgi-bin/view_post.cgi?mod=view&id=$1 [PT]

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] AliasMatch problem

Posted by Nick Kew <ni...@webthing.com>.
On Thu, 2 Sep 2004, Albert Vila wrote:

> Hi all,
>
>     I'm trying to find a solution to my problem using AliasMatch.

Wrong command.  For CGI that's ScriptAlias.

-- 
Nick Kew

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