Tag Info

New answers tagged

3

Your host name also needs to be added to /etc/hosts in 127.0.0.1 section. If you haven't rebooted since editing /etc/hostname you also need to set the hostname using the hostname command. This normally happens at bootup from /etc/hostname. Here is a script that I use to make sure the host name is set correctly on my Ubuntu ec2 instance: #!/bin/sh set -e ...


1

A few things: I am assuming that dom.ain is for our sake like example.com would be. I like it! Check the directory permissions for the DocumentRoot /var/www/html/git/project/app. It should be owned for the user that controls it in Apache. It depends on how your Apache is set-up but the user could be www-data or root. If you are using virtual hosting and a ...


0

If you ensured all the wanted folder names were present in the regex list then all others could be redirected to a 404 page using this .htaccess script: # If friendly URL dynamic folder not present in URL then respond HTTP 404 RewriteRule ^(user|fishes) - [R=404]


2

For Q1, the - doesn't mean that processing or iteration would be stopped, simply that the URL path would be passed through without any filtering or processing. The file will continue to execute rules until it reaches the end of the file or a rule is met that has the [L] last rule flag appended to it. To clarify then, RewriteRule .* - ...


0

I have realized that www.succeedonline.co.za does not yet redirect under the non-www site under the https protocall. It does however work fine under the http protocall. Here is an extract of my complete .htaccess file: RewriteOptions inherit RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] # add a trailing slash to /wp-admin RewriteRule ...


0

You could also take the approach of multiple rewrite rules. Replace example.com with your actual domain name. RewriteEngine On RewriteCond %{HTTPS} off # HTTPS is off! # Redirect to the secure canonical URL RewriteRule (.*) https://example.com/$1 [L,R=301] RewriteCond %{HTTP_HOST} !^example\.com$ [NC] # Host name is not correct! # (maybe it has a www?) ...


1

Not sure if this would encompass your goal completely, but this would turn http www mode into https non-www mode: RewriteEngine On RewriteCond %{HTTPS} off [OR] RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC] RewriteRule ^(.*)$ https://example.com/$1 [R=301,L] Then to redirect the whmcs to a new url, you can probably use a simple 301: Redirect 301 ...


0

Try this: #gateway.school.edu virtual host RewriteCond %{REMOTE_ADDR} ^10\.(.*)$ [OR] RewriteCond %{REMOTE_ADDR} ^172\.(.*)$ [OR] RewriteCond %{REMOTE_ADDR} ^192\.(.*)$ RewriteRule .* reset.school.edu [R=301,L] The .* is a wildcard. The \ escapes the . which anchors the match allowing it to be taken literally. The () may not be necessary- it is usually ...



Top 50 recent answers are included