minimum number of characters in an

Discuss practical ways rearrange URLs using mod_rewrite.

minimum number of characters in an

Postby Domen Lombergar » Thu Dec 23, 2004 8:50 am

Hey there.

I'm having the following issue with my mod_rewrite which looks like this:

RewriteRule ^([0-9-]*)/?$ displayimage.php?pos=-$1

This works swell if "http://www.lombergar.com/portfolio/279" is called but if nothing is called ("http://www.lombergar.com/portfolio"), then it calls http://www.lombergar.com/portfolio/disp ... .php?pos=- which gives out an error in the template due to the fact that it's an irregular expression.

Thus if it was an option to perhaps give out a minimum of 2 characters, before applying the rule, it would solve the problem.

Can this be done by any chance?
Domen Lombergar
 

Postby Domen Lombergar » Thu Dec 23, 2004 11:41 am

This was succesfully fixed, so if anyone comes from google to this topic, here is the sollution:

RewriteRule ^([0-9-]{1,5})/?$ displayimage.php?pos=-$1
Domen Lombergar
 


Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 77 guests

cron