I have some difficulties with the mod_rewrite rules.
I want to rewrite any request on
www.example.com/dev/*
to
www.example.com/*
For example when the request url is www.example.com/dev/index.php
, the response should be www.example.com/dev/index.php
, and not just that the url looks like it's from the root directory, but it is actually using the index.php
from root directory.
I have tried the mod_alias which works
RedirectMatch (^/dev/)(.*) http://www.example.com/$2
But it is not possible to apply ip address conditions with mod_alias, so I still need a solution with mod_rewrite.
Would anyone share some knowledge please? Thanks.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…