Mobile app version of vmapp.org
Login or Join

Login to follow query

More posts by @Dunderdale272

1 Comments

Sorted by latest first Latest Oldest Best

 

@Ann8826881

Since you've not clarified the specifics of your question, I'll make some assumptions:


You wish to redirect to a different domain. eg. example.net
example.net points to a different server.
/CDadmin is a physical directory on the filesystem.





At the top of the .htaccess file in the document root of example.com, place the following:

RewriteEngine On
RewriteRule (.*) example.net/ [R=302,L]


The only regex here is (.*) - which will basically redirect everything. (Read on...)

This is a temporary (302) redirect. Change to a 301 if you want to make it permanent.
Then, in the .htaccess file in the /CDadmin subdirectory, simply enable the rewrite engine:

RewriteEngine On


This will effectively override the mod_rewrite directives in the parent .htaccess file, so nothing will be redirected when accessing /CDadmin/<something>.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme