example.com/123456 in .htaccess

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi all,

I've to redirect an URL like www.example.com/123456 to something like
I've also to redirect an URL like www.example.com/m123456 to something like
www.example.com/index2r.php?ID=123456 (there is an additional element in the
first URL, the m before the number).

How to do so?
It is possible in .htaccess ?

Thanks for helping.

Re: example.com/123456 in .htaccess

On Tue, 20 Jan 2009 11:26:43 +0100, bob@bedford.com wrote:
Quoted text here. Click to load it

This has nothing to do with PHP.  Try alt.apache.configuration.

Before posting there, you should RTM:


$email = str_replace('sig.invalid', 'gmail.com', $from);

Re: example.com/123456 in .htaccess

Bob Bedford escribió:
Quoted text here. Click to load it

If you are using Apache you can easily do it with mod_rewrite:

http://httpd.apache.org/docs/2.2/en/rewrite /

You can't do it with PHP as far as I know.

-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://bits.demogracia.com
-- Mi web de humor al baño María: http://www.demogracia.com

Site Timeline