Reputation: 855
I use this:
RewriteRule ^(page-a[^/]+)/?$ /page.php?a=$1
the objective is to rewrite to pages like this:
http://www.website.com/page-a47643
now how can i match only strings containing NUMBERS following "page-a" ?
The problem is that the htaccess will mess up access to folder like this:
Upvotes: 1
Views: 1438
Reputation: 340
RewriteRule ^(page-a\d+)/?$ /page.php?a=$1
\d in Perl-compatible regular expressions (PCRE, as used by Apache) means "one digit". \d+ means "one or more digits".
Upvotes: 1
Reputation: 784918
Change your regex to:
RewriteRule ^(page-a[0-9]+)/?$ /page.php?a=$1 [L,QSA]
[0-9]+
will match 1 or numbers and will leave /page-about-me/
as is.
Upvotes: 1