•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Linux Servers and Apache section within the Tech Talk category of DaniWeb, a massive community of 392,045 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,279 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Linux Servers and Apache advertiser:
Views: 4326 | Replies: 2
![]() |
I have browsed through various forums in search of an answer to this:
I need https://www.domain.com to redirect to https://domain.com. Reason being, the cert is only valid for https://domain.com and not https://www.domain.com
This rewrite rule works fine to redirect:
==
rewriteEngine on
rewriteCond %{HTTP_HOST} !^domain\.com
rewriterule (.*) https://domain.com/$1 [R=301,L]
==
Only one problem. I still get prompted that the SSL cert is invalid for https://www.domain.com, and only after I accept the certificate in it's invalid state do I get redirected to https://domain.com. I have tried using this rewrite rule in .htaccess and the virtual host directive for 443 within httpd.conf. No luck.
My goal is to have https://www.domain.com redirected to https://domain.com before the cert prompt.
Note: The SSL-domain logs no longer show https://www.domain.com being accessed, but rather https://domain.com after the rewrite. Yet, still no success with redirecting before the cert check takes place.
Any suggestions?
I need https://www.domain.com to redirect to https://domain.com. Reason being, the cert is only valid for https://domain.com and not https://www.domain.com
This rewrite rule works fine to redirect:
==
rewriteEngine on
rewriteCond %{HTTP_HOST} !^domain\.com
rewriterule (.*) https://domain.com/$1 [R=301,L]
==
Only one problem. I still get prompted that the SSL cert is invalid for https://www.domain.com, and only after I accept the certificate in it's invalid state do I get redirected to https://domain.com. I have tried using this rewrite rule in .htaccess and the virtual host directive for 443 within httpd.conf. No luck.
My goal is to have https://www.domain.com redirected to https://domain.com before the cert prompt.
Note: The SSL-domain logs no longer show https://www.domain.com being accessed, but rather https://domain.com after the rewrite. Yet, still no success with redirecting before the cert check takes place.
Any suggestions?
I know this is silly...but I did it previously.
After making all of those changes to your apache configuration...did you restart apache? Last time I altered my .htaccess file I couldn't figure out why I wasn't getting prompted for a password (I added pword prot to a directory). Then I restarted apache and slapped my forehead EXTREMELY hard.
After making all of those changes to your apache configuration...did you restart apache? Last time I altered my .htaccess file I couldn't figure out why I wasn't getting prompted for a password (I added pword prot to a directory). Then I restarted apache and slapped my forehead EXTREMELY hard.
My Home Away from Home: Yet Another Linux Blog
•
•
•
•
Originally Posted by TKS
I know this is silly...but I did it previously.
After making all of those changes to your apache configuration...did you restart apache? Last time I altered my .htaccess file I couldn't figure out why I wasn't getting prompted for a password (I added pword prot to a directory). Then I restarted apache and slapped my forehead EXTREMELY hard.
You generally don't need to restart apache for the .htaccess files to take affect.
Thats odd.
Is there anyway you can send your visitors to http://domain.com before they access the ssl page??
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb Linux Servers and Apache Marketplace
•
•
•
•
apple bbc cd cellphone choose code computer core debian dell desktop development drivers enterprise fedora fiji games gentoo gpl hardware ibm infrastructure install kernel laptop linux marketing microsoft mobile news novell open open source openoffice operating os palm preinstall red hat rhel security server source sun system ubuntu unix vista web windows
- please helpme i have small doubt in post and pre increment operators (C)
- Java Stock Trend Analysis Program :) (Java)
- please help me to understand the mistake in my program (C)
- Stupid mistake? (C++)
Other Threads in the Linux Servers and Apache Forum
- Previous Thread: Hosting a windows webpage on a linux server
- Next Thread: domain/virtual hosts all messed up, can't see the files in FTP


Linear Mode