Hi, I am trying to use mod rewrite to obtain SEO friendly url's. I have a list of items producing like this: entertainment-listings.php?cat=private-events&title=accounts-and-financing What i would like the results coming out like is: e.g. www.website.com/private-events/accounts-and-financing.php Can someone advise me please. Cheers, Adam
RewriteEngine On RewriteRule ^([\w-]+)/([\w-]+)\.php$ entertainment-listings.php?cat=$1&title=$2 Code (markup):
I have another issue with this that i cannot figure out: What i have done is i have links like this: <a href="{$domain}/corporate-events/{$result.subcategory|stripres}.html" title="Corporate Events - {$result.subcategory}" class="submenu">{$result.subcategory}</a> With the re-write rule: RewriteRule ^corporate-events/(.*)\.html$ entertainment-listings.php?title=$1 This is working fine but what i want to do now is have the link like this: <a href="{$domain}/{$resultb.region|stripres}/{$cat}/{$pagename|stripres}.html" title="{$resultb.area} - {$resultb.region}" class="submenu">{$resultb.region}</a> What would the re-write be on this? Cheers, Adam
RewriteRule ^corporate-events/(.*)\.html$ entertainment-listings.php?title=$1 Code (markup): The (.*) is greedy. Try (.*?) RewriteRule ^corporate-events/(.*?)\.html$ entertainment-listings.php?title=$1 Code (markup): Jay