I have my .htaccess code as follows :
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/aboutus
RewriteRule ^(.*)$ http://www.mydomain.com/admin/loadhomepages/aboutus [P]
RewriteCond %{REQUEST_URI} ^/contactus
RewriteRule ^(.*)$ http://www.mydomain.com/admin/loadhomepages/contactus [P]
</IfModule>
Individually all works fine , but i need a wild card redirection .That is , I want to redirect all the request follows the pattern of http://www.mydomain.com/{mystring}
to http://www.mydomain.com/admin/loadhomepages/{mystring}
. Thanks
You can use:
RewriteRule (?!^admin/loadhomepages/)^(.+)$ /admin/loadhomepages/$1 [P,NC,L]
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^aboutus$ http://www.mydomain.com/admin/loadhomepages/aboutus [L]
RewriteRule ^contactus$ http://www.mydomain.com/admin/loadhomepages/contactus [L]
RewriteRule ^(.*)$ http://www.mydomain.com/admin/loadhomepages/$1 [L]
</IfModule>