hi, I have been trying to do my .htaccess all day the best I can get is this: to www.ebooklobby.com/details/51/Life%2520in%2520the%2520Red%2520Brigade/?id=51&title=Life%2520in%2520the%2520Red%2520Brigade Code (markup): I want to get rid of the ?id=51&title=Life%2520in%2520the%2520Red%2520Brigade on the end. On the link to the page I pass the id and title parameters is there a way to remove them from the end of the url. Also I want to get rid of the %2520 characters. The url I want is http://www.ebooklobby.com/ebook-title/ Code (markup): Here is the code of the .htaccess file RewriteEngine on # # Internally rewrite search engine friendly static URL to dynamic filepath and query RewriteRule /([^/]+)/([^/]+)/?$ /details.php?id=$1&title=$2 [L] # # Externally redirect client requests for old dynamic URLs to equivalent new static URLs RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /details\.php\?id=([^&]+)&title=([^&]+)\ HTTP/ RewriteRule ^details\.php$ [url]http://www.ebooklobby.com/details/%1/%2/[/url] [R=301,L] Code (markup):
Post an example of the original URL and how you want it. The number will have to be there some where. The %2520 part will have to be edited in the script.
thanks for the reply original http://www.ebooklobby.com/details.php?id=8&title=The%20Sett%20And%20Weaving%20Of%20Tartans%20&catname=Art Code (markup): how I want it http://www.ebooklobby.com/art/The-Sett-And-Weaving-of-Tartans Code (markup):
Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^([^.]+)/([^.]+)/([^.]+)$ details.php?id=$1&title=$3&catname=$2 [L] You can't have it unless you have the ID there. http://www.ebooklobby.com/id/art/The-Sett-And-Weaving-of-Tartans Only the script can change the %20.
You have to edit the script so it doesn't have that in the link. That's a space in the URL. Like changing it to -.
the links are pulled from the database, it uses the title of the article as the link. I ain't too sure how I would edit the title to cater for the url. I was thinking of doing a regular expresion on it to replace the #20 with a -.
<?php $string = 'page title blah hasdhasd'; $pattern = '/ /i'; $replacement = '-'; echo preg_replace($pattern, $replacement, $string); ?> I used code similar to the above to sort it out, thanks for your help.