page.php?name=' .$row->item_id . '
How do i mod_rewrite this?
| SitePoint Sponsor |
page.php?name=' .$row->item_id . '
How do i mod_rewrite this?
Found it out, RewriteRule ^page/([^/]+)/?$ page.php?name=$1 [L]
stupid me





You might want to limit the rule, if your name only contain letters or numbers, then you only want the rule to work then.
Hmm i don't get this:
page.php?name=' .$row->item_id . '/' .$row->item_title . '
i want to display it like page/id/nice-title/
When i add item_title the page redirect don't work.
But with only page/id it works..
But i want to item_title on the end. But its more dummie so it looks nice.
Because page/id/ only is little bit bored and not seo friendly.
How can i do this?


you need to add another 'atom' to your mod_rewrite to cath the item_title.
Post your mod_rewrite as it is now
Mike Swiffin - Community Team Leader
Only a woman can read between the lines of a one word answer.....
I started out with nothing... and still got most of it left!
I got this,
page.php?name=' .$row->item_id . '/' .$row->item_title . '
want to display page/id/fancy-title-here
The items with atom parsing works fine.
And the page/id/ redirect works fine to, i only want to add fancy-title-here from item_title. But if i add it the redirect is broken.


then you would need something like
and you link:Code:RewriteRule ^page/([^/]+)/([^/]+)/?$ page.php?name=$1&title=$2 [L]
PHP Code:page.php?name=' .$row->item_id . '&title=' .$row->item_title . '
Mike Swiffin - Community Team Leader
Only a woman can read between the lines of a one word answer.....
I started out with nothing... and still got most of it left!
Thanks works great![]()
Bookmarks