Closed Thread Icon

Topic awaiting preservation: redirect via .htaccess [regular expressions] (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=13031" title="Pages that link to Topic awaiting preservation: redirect via .htaccess [regular expressions] (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: redirect via .htaccess [regular expressions] <span class="small">(Page 1 of 1)</span>\

 
u-neek
Bipolar (III) Inmate

From: Berlin, Germany
Insane since: Jan 2001

posted posted 01-08-2004 21:31

I want wo rewrite every url from domain.com/numbers/numbers/numbers/ to /index.php?url=/numbers/numbers/numbers/

Numbers *are* numbers! (2003, 2004, 12, 2736, 3,...)

This is what i have so far:
RewriteEngine on
RewriteRule ^(.*)/(.*)/(.*)/ /index.php?url=$1/$2/$3

But this only redirect from domain.com/321/13/123/ to index.php?url=321/13/123

Not domain.com/321/13/123 (<- without the slash at the end). Nor domain.com/321/13/123/index.php

Any regular expression, that will solve this problem?

Thanks.

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 01-08-2004 22:20

sure

^/([0-9])/([0-9]*)/([0-9]*).*

Generally using .* isn't a great idea. Always try to match as specifically as possible.



.:[ Never resist a perfect moment ]:.

u-neek
Bipolar (III) Inmate

From: Berlin, Germany
Insane since: Jan 2001

posted posted 01-08-2004 22:40

Thanks.

I've removed the first slash and fixed some meta-characters for my needs and now it work.

This is my final pattern: ^([0-9]+)/([0-9]+)/([0-9]+).*

« BackwardsOnwards »

Show Forum Drop Down Menu