diff --git a/xCAT-UI/etc/apache2/conf.d/xcat-ui.conf.apach22 b/xCAT-UI/etc/apache2/conf.d/xcat-ui.conf.apach22
new file mode 100644
index 000000000..11d5b3445
--- /dev/null
+++ b/xCAT-UI/etc/apache2/conf.d/xcat-ui.conf.apach22
@@ -0,0 +1,15 @@
+Alias /xcat "/opt/xcat/ui"
+PHPINIDir "/opt/xcat/ui"
+
+# Redirect all http request to https
+RewriteEngine On
+RewriteCond %{SERVER_PORT} 80
+RewriteCond %{HTTPS} !=on
+RewriteRule ^/?xcat/(.*) https://%{SERVER_NAME}/xcat/$1 [R,L]
+
+
+ Options FollowSymLinks
+ AllowOverride None
+ Order allow,deny
+ Allow from all
+
diff --git a/xCAT-UI/etc/apache2/conf.d/xcat-ui.conf.apach24 b/xCAT-UI/etc/apache2/conf.d/xcat-ui.conf.apach24
new file mode 100644
index 000000000..c6a9de325
--- /dev/null
+++ b/xCAT-UI/etc/apache2/conf.d/xcat-ui.conf.apach24
@@ -0,0 +1,14 @@
+Alias /xcat "/opt/xcat/ui"
+PHPINIDir "/opt/xcat/ui"
+
+# Redirect all http request to https
+RewriteEngine On
+RewriteCond %{SERVER_PORT} 80
+RewriteCond %{HTTPS} !=on
+RewriteRule ^/?xcat/(.*) https://%{SERVER_NAME}/xcat/$1 [R,L]
+
+
+ Options +FollowSymLinks
+ AllowOverride None
+ Require all granted
+