Q:

Apache rewrite rule (url rewriting)

How can make a url rewriting for example, I want my to look like
www.myurl.com/study-abroad/what/ever/

If I type
www.myurl.com/studyabroad/what/ever/

The idea is to have study-abroad instead of studyabroad

A:

It can be done if you know in advance with how many dashes per URL you'd be confronted:
RewriteEngine On

# Replacing a single dash, e.g. example.com/study-abroad/what/ever
RewriteCond %{REQUEST_URI} ^([^-]*)-([^-]*)$
RewriteRule ^([^-]*)-([^-]*)$ $1$2 [L]

# Replacing two dashes, e.g. example.com/study-abroad/what-ever
RewriteCond %{REQUEST_URI} ^([^-]*)-([^-]*)-([^-]*)$
RewriteRule ^([^-]*)-([^-]*)-([^-]*)$ $1$2$3 [L]

... and so forth.  May I add, though, that this is broken by design and you should reconsider your approach. 
Regards

