Jump to content

Archived

This topic is now archived and is closed to further replies.

AdRock

2 really simple mod rewrite questions

Recommended Posts

I have this rewrite rule which reads [url=http://www.jackgodfrey.org.uk/news/1/2]www.jackgodfrey.org.uk/news/1/2[/url]

[b]RewriteRule ^([A-Za-z0-9]+)/([0-9]+)/([0-9]+)/?$ index.php?page=$1&limit=$2&pagenum=$3 [L][/b]

How would I rewrite that to read [url=http://www.jackgodfrey.org.uk/news/2]www.jackgodfrey.org.uk/news/2[/url] so it takes the /1/ out as that never changes.  It's only a limit to how many records are listed per page

The second question is this:

I have 4 pages names jack1, jack2, jack3 and jack4

How would i create a rule to read like this [url=http://www.jackgodfrey.org.uk/jack/1]www.jackgodfrey.org.uk/jack/1[/url] etc?

Share this post


Link to post
Share on other sites
Do you wantr to get rid of the limit parameter completly if so use this:
[code]RewriteRule ^([A-Za-z0-9]+)/([0-9]+)/?$ index.php?page=$1&pagenum=$2 [L][/code]

For your secound question, I'm not sure but prehaps this:
[code]RewriteRule ^jack/([0-9]+)/$ jack$1.php[/code]
by file name you mean jackx.php, x being a number?

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.