1zeus1;11021451 wrote:Hello
This is a problem I encountered when Im trying to convert my dynamic url to friendly url.
I have a URL like this
[noparse]www.example.com/sito/index.php?q=hello
I need to rewrite it like this
www.example.com/sito/hello[/noparse]
There is p*rn in your URL examples. Even if this is the actual site you're working on, you might want to replace those with [font=monospace]example.com[/font].
Here's the basic problem I see (and you may already realize this, so please don't take offense):
There is no need for any code to "convert" your URLs. It is as simple as writing
"[font=monospace]<a href="http://example.com/sito/hello">hello</a>[/font]"
instead of "[font=monospace]<a href="http://example.com/sito/index.php?q=hello">hello</a>[/font]".
What you're probably trying to figure out is how to get that "friendly" URL to arrive at the right page. You should read about mod_rewrite.
[font=monospace].htaccess[/font]
(This may or may not be "just what you need" depending on your actual objective.)
RewriteEngine On
RewriteRule ^sito/(.*)$ sito/index.php?q=$1