bear
bear

Reputation: 11615

writing mod-rewrite rules

I'm trying to write a htaccess file for the following URL to be parsed.

/folder/title-of-article/id=6

to be passed to-

/page.php?id=6

How do I do this?

Upvotes: 0

Views: 32

Answers (1)

poncha
poncha

Reputation: 7866

Assuming your article title cannot contain slashes, You can use this:

RewriteEngine On
RewriteRule ^folder/[^/]+/id=([0-9]+)$ /page.php?id=$1

This will match /folder/<anything not containing slashes>/id=<digits>

Upvotes: 1

Related Questions