View Full Version : Mod rewrite - using server URL

11-02-2010, 10:36 AM
I'm trying to rewrite a wierd URL i haven't done before i think its conflicting with the curly character.

The url is:


I wanted to turn this url, using .htaccess into SEO friendly such as:


I have tried counless menthod to achive this with no luck.

I have tryed this and others.

RewriteRule /(.*)/$ /\~insurance/index.php?insurancetype=$1

Thanks the help. much appreciated.

11-02-2010, 09:42 PM
The symbol is called 'Tilde' (usually pronounced 'tilda') and I would wonder why you are escaping it in the substitution. Now in the match would be something different :-)

Basically what you have there won't work. Say you call up


Your rewrite - if it worked -would (I think) try and translate that URL to something like this:

The backslash would probably result in a 404 (or even a 500 internal) error.

Depending on how many querystring elements you have I would look at using RewriteCond to do the matching making use of %{QUERY_STRING} and back references.

This will give you a pointer: http://www.simonecarletti.com/blog/2009/01/apache-rewriterule-and-query-string/