I'd like only my base domain www.domain.com to be rewritten to https://www.domain.com
By default in my https block I have it reroute to http:// if it's not ~uri = "/" (base domain) or static content.
server {
listen 443;
set $ssltoggle 2;
if ($uri ~ ^/(img|js|css|static)/) {
set $ssltoggle 1;
}
if ($uri = '/') {
set $ssltoggle 1;
}
if ($ssltoggle != 1) {
I read through some guides on this and I believe it is possible to have apache respond to a subdomain through ssl. I have domain.com responding on 80 and I do not need domain.com responding on 443.
I know this must have been answered a million times but I can't seem to get it to work
I would like to redirect a subdomain to a subdirectory.
I am currently using
server {
server_name sub.domain.com;
rewrite ^(.*) http://www.domain.com/sub-directory permanent;
}
If I navigate to sub.domain.com I am redirected to http://www.domain.com
EDIT
Here's my full config.
Hello I have a few questions regarding installation of SSL.
The domain for the cpanel account I want to use ssl for is domain.com but I have rewrites to www.domain.com in my .htaccess file.
From what I've read I should get a certificate for www.domain.com then, is this correct?
Should I generate the signing request in WHM or cpanel?
I have: - two DNS servers: 1.1.1.1 and 2.2.2.2 - domain name: domain.com pointed to 1.1.1.1
I want to point sub domain: sub.domain.com to 2.2.2.2 (obviously www.sub.domain.com too)
on 1.1.1.1 I've create a DNS A record pointing sub.domain.com to 2.2.2.2
accessing sub.domain.com now lead to 2.2.2.2 successfully
the problem is the DNS records on 2.2.2.2 such as CNAME www do not work means access
Here's a quick summary of the environment I support: we have a domain (domain A) that has about 20 client computers. The domain server for this domain and all the clients sit within the network infrastructure of a larger domain (domain B). All the computers get their network settings via DHCP from domain B's servers.
I've been looking for a solution to the following problem for a few days now.
I have domain.com for which I have bought and installed a wildcard certificate so now I can provide secure access to www.domain.com or whatever.domain.com.
what is the best possible way to redirect and rewrite url in virtual host file?
I want to make sure it is not heavy on the server.
I tried many ways on the virtualhost file but when I restart the apache it fails. I dont want to use .htaccess...
#Hide Index
IndexIgnore *
#Define ErrorDoc
ErrorDocument 404 http://www.domain.com
#REDIRECTS
Redirect 301 /page.php http://domain.com
Redirect 301 /inc/page.php http://domain.com
Options +FollowSymlinks
RewriteEngine on
#Redirect all pages in a folder to a single URL
RewriteRule ^dir/(.*)$ http://domain.com/index.php [L,R=301]
#Redirect String
RewriteRule ^index.php?var1=value&var2=(.*)