I've some problems with the mod_rewrite rules. I wish to rewrite any request on

www.example.com/dev/*

to

www.example.com/*

For instance once the request url is www.example.com/dev/index.php, the response ought to be www.example.com/dev/index.php, and not simply the url appears like it's in the root directory, but it's really while using index.php from root directory.

I've attempted the mod_alias which works

RedirectMatch (^/dev/)(.*) http://www.example.com/$2

But it's difficult to use ip conditions with mod_alias, and so i still require a solution with mod_rewrite.

Would anybody share some understanding please? Thanks.

What about something similar to this?

RewriteRule ^dev/(.*)$ $1

This will have to maintain the main folder, or put on the main Apache configuration (not inshtaccess).

The typical rules about .htaccess redirects apply - including that RewriteEngine on, Options FollowSymLinks, and AllowOverride FileInfo are incorporated somewhere. Full particulars at http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewriterule.