SEO-friendly links and pagination

Hello Mod_rewrite Guru’s.

I am in need of some assistance.

My current mod-rewrite for subdomains is working excellently! However I need to add in some pagination and also some article viewing.

Here is what I currently have:


RewriteEngine On

RewriteCond %{HTTP_HOST} !^www\\.domain\\.com [NC]
RewriteCond %{HTTP_HOST} ^([a-z0-9]+)\\.domain\\.com
RewriteRule (.*) index.php?c=%1 [L,QSA]

Now what I want to do is have mod_rewrite receive:


subdomin.domain.com/xx

as:


domain.com/?c=subdomain&p=xx

for my pagination.

Additionally if possible

I would also like to make it so I can view single articles from my blog. So if someone were to type in:


subdomain.domain.com/article/articlenumber/

it would be received as:


domain.com/?mode=article&article=articlenumber

Any help or pointers in the right direction would be amazing! Thanks for reading!

rev,

This is similar to another recent post (isosytech’s) but you need to take care with your RewriteRules because the “article/###” will be matched with the typical “lazy regex” employed by regex newbies.

Because it’s long after the “witching hour” in NZ, let me refer you to the tutorial linked in my signature (regex is covered as well as many examples) and I’ll get back in the (later) AM to help you through whatever code you’ve tried.

G’nite!

DK