Rewrite conditions for URLs like this

How do I go about writing the conditions for mod_rewrite to make this example happen?

Have a URL this like...

Render this page...

And if there is no page number specified (note I want it to work with or without trailing-slash)...

It will default to page 1...

But when someone just goes to the root domain...

I want this page to render...

Thanks for any help.


Put this in the htaccess file in your document root:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/([0-9]+) /index.php?view=$1&page=$2 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/?$ /index.php?view=$1 [L,QSA]
RewriteRule ^$ /index.php?view=popular&page=1 [L,QSA]

Need Your Help

User Click Tracking Library for Desktop App

c# desktop-application user-input tracking user-tracking

We are looking into the possibility of allowing users to opt into a program where they report what button clicks etc. they do, and I was wondering if anyone can suggest a good library which already...

drawRect:/renderInContext: issues

ios uiview calayer exc-bad-access drawrect

Seem to be having a bit of an issue trying to draw my view into a context.