Gossamer Forum
Home : General : Internet Technologies :

Help Please - Apache Related

Quote Reply
Help Please - Apache Related
I know that this isn't exactly related to perl, but I see a lot of reg exp stuff going on here so I figure someone here could help me. What I am trying to do is get something like

http://www.bob.com/blog/v/32 redirect to http://www.bob.com/blog/index.php?a=view&id=32

I prefer that its something that doesn’t use mod_rewrite. I experimented with RedirectMatch, but couldn't get it to work. I'm thinking it has to be possible using RedirectMatch

It doesn't matter what .htaccess file its in as long as it works. Either the server root, or the /blog .htaccess file.



Thanks in advance. Appreciate it much
Quote Reply
Re: [american12] Help Please - Apache Related In reply to
Code:
RedirectMatch /blog/v/(\d+)/?$ http://www.blog.com/blog/index.php?a=view&id=$1

I have no idea if that will work.

Last edited by:

Paul: Oct 20, 2002, 3:00 AM
Quote Reply
Re: [Paul] Help Please - Apache Related In reply to
Thanks anyway but it doesn't work Unsure.

Any other ideas?
Quote Reply
Re: [american12] Help Please - Apache Related In reply to
Anyone?! Shocked
Quote Reply
Re: [american12] Help Please - Apache Related In reply to
Try not putting what you are redirecting inside of where you are redirecting too. That's just asking for trouble. i.e.

RedirectMatch /v/(\d+)/?$ http://www.blog.com/...php?a=view&id=$1

That way you don't need to worry about /blog/index.php getting captured by the redirectmatch. So now you would go to http://blog.com/v/32.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Help Please - Apache Related In reply to
Thanks for you effort, but it still dosen't work.

This is what I'm putting in:

Code:
RedirectMatch /v/(\d+)/?$ http://www.site.com/weblog/index.php?a=view&id=$1


The error log has no indication as too why its an error. Just says:

[Mon Oct 21 13:23:47 2002] [error] [client 63.199.200.47] File does not exist: /home/virtual/site186/fst/var/www/html/v/2



I'm not sure what I'm doing wrong. Any ideas?
Quote Reply
Re: [american12] Help Please - Apache Related In reply to
Hello american12,

I placed a .htaccess file inside the directory I wished redirection from and redirected to /cgi-bin/e.pl

Code:
RedirectMatch permanent ^(.*)$ /cgi-bin/e.pl?a=$1


Yours may look like : RedirectMatch permanent ^.v|V/(\d+)/$ /weblog/index.php?a=view&id=$1


Hope this helps

kode

Last edited by:

kode: Oct 22, 2002, 5:25 AM
Quote Reply
Re: [kode] Help Please - Apache Related In reply to
It dosen't work. I thought it might have to do with my apache settings, but just using the Redirect command works fine.

Redirect /bob to /~bob

I tried what Kode said in the root .htaccess file, and then tried creating a folder called /v and placed in it that folder. Neither worked.

Unsure