more_rewrite issue

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

more_rewrite issue

Post by itsmani1 »

reason for the mod_rewrite is that i want to make pages like /xxxx/xxxx.html etc
just new to reguller expressions
tried this:
^([a-zA-Z]+$\[0-9]+$\(.*).html$) viewtickets.php?ContentID=$2

Code: Select all

need rule that can send
/xxxxxx/111111/abc.html to index.php?cid=111111
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

itsmani1 wrote:tried this:
^([a-zA-Z]+$\[0-9]+$\(.*).html$) viewtickets.php?ContentID=$2
and then what happend?
try to explain your current pattern, e.g. [0-9]+ matching one or more digit
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

Post by itsmani1 »

Code: Select all

^([a-zA-Z]+$\[0-9]+$\(.*).html$) viewtickets.php?ContentID=$2
[a-zA-Z]=> a to z and A to Z
[0-9] => 0 to 9
(.*) => anything will come
.html => ends at .html
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

So why do you have + and $ in the expression??

Btw:
.html means: match any character and then the characters 'html'
\.html means: meatch the characters '.html'
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

timvw wrote:So why do you have + and $ in the expression??
Not only that but all the red parts are not explained.
itsmani1 wrote: ^([a-zA-Z]+$\[0-9]+$\(.*).html$) viewtickets.php?ContentID=$2
Post Reply