We can use setup Apache Web server's mod_rewrite to redirect everything except selected directories.
Let's consider two scenarios.
-
Whole site redirection. Let's assume we want to redirect
http://www.mydomain.com
tohttps://secure.mydomaintoo.com
, however, except directoriesupload1
andupload2
, we place a.htaccess
file at the root directory of the system, e.g.,/var/www/html
,RewriteEngine On RewriteCond %{REQUEST_URI} !^/upload1/.* RewriteCond %{REQUEST_URI} !^/upload1$ RewriteCond %{REQUEST_URI} !^/upload2/.* RewriteCond %{REQUEST_URI} !^/upload2$ RewriteRule ^(.*)$ https://secure.mydomaintoo.com/$1 [R=301,L]
-
Subsite redirection. Let's assume we want to redirect
http://www.mydomain.com/~subsite/
tohttps://secure.mydomaintoo.com
, however, except directoriesupload1
andupload2
, we place a.htaccess
file at the root directory of the system, e.g.,/var/www/html
,RewriteEngine On RewriteCond %{REQUEST_URI} !^/~subsite/upload1/.* RewriteCond %{REQUEST_URI} !^/~subsite/upload1$ RewriteCond %{REQUEST_URI} !^/~subsite/upload2/.* RewriteCond %{REQUEST_URI} !^/~subsite/upload2$ RewriteRule ^(.*)$ https://secure.mydomaintoo.com/$1 [R=301,L]
i need this, thanks https://www.money.id/finance/first-jobber-lebih-butuh-asuransi-kesehatan-atau-jiwa-160923x.html/
ReplyDelete