Hi, I have rewritten a page url like this: imagepage.php?id=45 => http://www.site.com/image/45/ imagepage.php?id=46 => http://www.site.com/image/46/ imagepage.php?id=47 => http://www.site.com/image/47/ But all these images have a name that is taken from a database, i read them in the php file and show this name on the page. But, i actually want the name of the image also in the url, like this: http://www.site.com/image/name-of-image-here/ Is this possible?
How about this: http://www.site.com/image/45/something.html => imagepage.php?id=45 http://www.site.com/image/46/something.html => imagepage.php?id=46 http://www.site.com/image/46/another.html => imagepage.php?id=46 ie, put your image-name in url, but ignore it on your RewriteRule. NOTE that I've used .html extension, this is because sometimes crawlers are trying to get partial URLs trying to detect duplicated urls. Example: for "http://www.site.com/image/46/" you should return a 404 page. Another better method could be requiring always a specific substring (like a fixed KEYWORD) just before the ".html" string. Exmaple: http://www.site.com/image/46/another-KEYWORD.html => imagepage.php?id=46 http://www.site.com/image/46/another.html => 404 page TIP: Is better '-' than '_' in urls.
On "something" and on "another" you can fill any phrase you like (extracted from your DB), because it's to be ignored by your RewriteRule. The second method, adding fixed keywords to the phrase used on 1st method (also ignored by your RewriteRule), is only to fight against crawlers with partial strings: on "KEYWORD" you need to put a FIXED PHRASE (related to your site) no extracted from DB. So the last part of your URL (after last '/') is formed with "a phrase extracted from DB" + "a fixed phrase" (to match your RewriteRule). Of course you can define several RewriteRule with different FIXED PHRASES.
If I put a keyword extracted from the DB there and it is ignored by the mod rewrite rules, will search engines ignore it too ? Because the only reason i want each page url to end with KEYWORD.html, is to be more search engine friendly.
That's why I recomment to adding a fixed phrase after DB phrase: to not be caught by search engines. I've sent you a PM with a working example on my site.
I guess no. Only if you use different URLS (ie different phrases to be ignored) to provide same content. That way you get penalized for duplicate content.