Thanks you so much for your email. 

Here Is my httpd.conf inorder to achieve whoever type
http://newtraffic.cyberia.net.sa then it should redirect https://newtraffic.
cyberia.net.sa 



=============================================
<VirtualHost *:80>
    DocumentRoot /usr/share/cacti
    ServerName newtraffic.cyberia.net.sa
#    RedirectMatch "^/$" "https://newtraffic.cyberia.net.sa/cacti/";
    Redirect permanent "/" "https://newtraffic.cyberia.net.sa/";
    ErrorLog   /var/log/httpd/error_log
</VirtualHost>

===================================================

When I tried to check from browser, I got the below.  where as my apache is
listening on both ports 80 and 443. Please assist. 



==================================================
Bad Request
Your browser sent a request that this server could not understand.
Reason: You're speaking plain HTTP to an SSL-enabled server port.
Instead use the HTTPS scheme to access this URL, please.
=============================================================


===============
[root@nc rra]# service httpd status
Redirecting to /bin/systemctl status httpd.service
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor
preset: disabled)
  Drop-In: /usr/lib/systemd/system/httpd.service.d
           └─php-fpm.conf
   Active: active (running) since Tue 2020-08-11 10:39:10 +03; 4s ago
     Docs: man:httpd.service(8)
 Main PID: 285583 (httpd)
   Status: "Started, listening on: port 443, port 80"
    Tasks: 213 (limit: 307056)
   Memory: 46.3M
   CGroup: /system.slice/httpd.service
           ├─285583 /usr/sbin/httpd -DFOREGROUND
           ├─285584 /usr/sbin/httpd -DFOREGROUND
           ├─285585 /usr/sbin/httpd -DFOREGROUND
           ├─285586 /usr/sbin/httpd -DFOREGROUND
           └─285587 /usr/sbin/httpd -DFOREGROUND

Aug 11 10:39:10 nc.cyberia.net.sa systemd[1]: Starting The Apache HTTP
Server...
Aug 11 10:39:10 nc.cyberia.net.sa systemd[1]: Started The Apache HTTP
Server.
Aug 11 10:39:10 nc.cyberia.net.sa httpd[285583]: Server configured,
listening on: port 443, port 80
[root@nc rra]# vi /etc/httpd/conf/httpd.conf
-----Original Message-----
From: Freek de Kruijf [mailto:f.de.kru...@gmail.com] 
Sent: Tuesday, August 11, 2020 10:25 AM
To: users@httpd.apache.org
Subject: Re: [users@httpd] http-https

Op dinsdag 11 augustus 2020 09:00:35 CEST schreef MEjaz:
> Hello,.
> 
> 
> 
> I have requirement to redirect the url. Whoever typed my site 
> http://newtraffic.cyberia.net.sa , it should redirect to 
> https://newtraffic.cyberia.net.sa
> 
> 
> 
> I am bit struggling to achieve this. please assit
> 
> 
> 
> Ejaz

You can do this with a directive in the .conf file for
http://newtraffic.cyberia.net.sa : 
Redirect permanent "/" "https://newtraffic.cyberia.net.sa/";

--
fr.gr.

Freek de Kruijf




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org

Reply via email to