I have actually followed this example and it worked for me 🙂
NameVirtualHost *:80 <VirtualHost *:80> ServerName mysite.example.com Redirect permanent / https://mysite.example.com/ </VirtualHost> <VirtualHost _default_:443> ServerName mysite.example.com DocumentRoot /usr/local/apache2/htdocs SSLEngine On # etc... </VirtualHost>
Then do:
/etc/init.d/httpd restart
Related Posts:
- Bash: No such file or directory?
- PHP and mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
- Apache server keeps crashing, “caught SIGTERM, shutting down”
- httpd: Could not reliably determine the server’s fully qualified domain name, using 127.0.0.1 for ServerName
- Configuring Apache for localhost
- .htaccess file missing from WordPress install directory
- How do I grep recursively?
- error: ‘Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)’ — Missing /var/run/mysqld/mysqld.sock
- “E: Unable to locate package python-pip” on Ubuntu 18.04 [duplicate]
- -bash: syntax error near unexpected token `newline’ for display command
- How do I use grep to search the current directory for all files having the a string “hello” yet display only .h and .cc files?
- SSH using python script
- Changing the resolution of a VNC session in linux
- Building HelloWorld C++ Program in Linux with ncurses
- How does “cat << EOF" work in bash?
- X11 forwarding request failed on channel 0
- What is difference between arm64 and armhf?
- Opening a .tar.gz file with a single command
- How to make and apply SVN patch?
- How to download a file from server using SSH?
- What is Options +FollowSymLinks?
- htaccess – Redirect to subfolder without changing browser URL
- connect to host localhost port 22: Connection refused
- Implementing shell in C and need help handling input/output redirection
- Can you Run Xcode in Linux?
- Post request with Wget?
- Implementation of multiple pipes in C
- chmod: changing permissions of ‘my_script.sh’: Operation not permitted
- Terminal Multiplexer for Microsoft Windows – Installers for GNU Screen or tmux
- Is there an alternative sleep function in C to milliseconds?
- Gedit command not working in kali linux terminal
- Syntax error near unexpected token ‘then’
- Curl : connection refused
- make -j 8 g++: internal compiler error: Killed (program cc1plus)
- How can I use grep to show just filenames on Linux?
- Bash script prints “Command Not Found” on empty lines
- Bash export command
- How to edit gitignore file
- Linux Bash: Move multiple different files into same directory
- how to search for a directory from the terminal in ubuntu
- How to use dos2unix?
- How to add a default include path for GCC in Linux?
- How does one suppress a 404 status code in a WordPress page?
- Use subdomain for certain urls
- A plugin changes my .htaccess file and I can’t access httpd.conf as that’s a shared server
- Redirect from different port to subdomain – htaccess
- Only expose routes with prefix /wp-json on WordPress using Apache
- Restrict uploaded files into a custom folder to logged in users by htaccess: looking for Nginx – not only Apache – solution
- How do I test to ensure that my wp-config file is protected?
- .htaccess Security Header Rules
- mod_rewrite loop, redirecting http to https on certain section of wordpress blog
- .htaccess in subdir gets ignored by WordPress’ own .htaccess in /
- Does WP suppresses .htaccess if permalinks are disabled?
- How do I do a redirect to WordPress permalink with post id via htaccess?
- WordPress permalinks confusion
- https and wordpress breaks posts
- How to configure both webserver and appserver for WordPress CMS?
- How to remove all plugins, posts, pages, and inactive themes in one line with wp-cli? WordPress bloatware removal
- How come there is no error if I upgrade WordPress core after locking .htaccess permissions to 644?
- How to move wordpress website from hosting account to localhost
- Strange special character/Latin characters
- I can access subdirectory, but not files within it
- What to do after a wrong RewriteRule?
- How can I set up a completely separate (not multisite) WordPress installation as a subdirectory of an existing WordPress blog?
- Communcation with wordrpess and linux server [closed]
- WordPress redirection
- Anyone else experiencing high rates of Linux server crashes during a leap second day?
- What permissions should my website files/folders have on a Linux webserver?
- Can I automatically add a new host to known_hosts?
- Can I nohup/screen an already-started process?
- How can I run Debian stable but install some packages from testing?
- Environment variables of a running process on Unix?
- In my /etc/hosts/ file on Linux/OSX, how do I do a wildcard subdomain?
- Shell command to monitor changes in a file
- Meaning of the buffers/cache line in the output of free
- How to cd into a directory with this name “-2” (starting with the hyphen)?
- how to disable SSH login with password for some users?
- Difference in sites-available vs sites-enabled vs conf.d directories (Nginx)?
- Is it possible to detach a process from its terminal? (Or, “I should have used screen!”) [duplicate]
- Disk full, du tells different. How to further investigate?
- Filename length limits on linux?
- best way to clear all iptables rules
- How can I port forward with iptables?
- Why do we use a OS Base Image with Docker if containers have no Guest OS?
- How can I rename a Unix user?
- How to re-order windows, change the scroll shortcut, and modify the status bar contents in GNU Screen?
- How to make Windows 7 USB flash install media from Linux?
- How to install/change locale on Debian?
- What limits the maximum number of connections on a Linux server?
- How to prevent a user from login in, but allow “su – user” in Linux?
- I have a keypair. How do I determine the key length?
- How to do the port forwarding from one ip to another ip in same network?
- Why drop caches in Linux?
- Linux – Is there a way to prevent/protect a file from being deleted even by root?
- swap partition vs file for performance?
- Best way to disable swap in Linux
- How to remove invalid characters from filenames?
- How can I zip/compress a symlink?
- How to find the physical volume(s) that hold a logical volume in LVM
- Browser Caching .htaccess