Tag Info

Hot answers tagged

5

You should post directly to an https: URL. User agents do not resubmit the POST request if the response was a 301 or 302. And while the 307 status code can be used to indicate that the POST request should be resubmitted, most user agents do not support it.


3

Try this RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] I think you might have to call that rule the last one, and then do the suffixing on the next visit when https is there.


3

So can I achieve this: When I go to: www.websitename.com/data/ it should give an 404 error. And when do www.websitename.com/data/welcome.php it should work. You can simply rewrite every request to a 404 not found status with an exception to welcome.php. In the code below you will see that every rule gets rewritten tot a 404 status with the exception ...


2

Don't point at an external url Apache's docs say: The syntax is, ErrorDocument <3-digit-code> <action> where the action can be, Text to be displayed. Wrap the text with quotes ("). An external URL to redirect to. A local URL to redirect to. Pointing at an external url will cause an actual redirect, whereas using a ...


2

You should try to use absolute or relative path and not an URL My apache2.conf : ErrorDocument 403 /error/403.html ErrorDocument 404 /error/404.html ErrorDocument 500 /error/500.html


1

First of all .htaccess files are intended to have effect in the directory they're placed, so rather than having one in /var/www/ typically you would have two: one in each of /var/www/impdata/ and /var/www/data/ Or rather have no .htaccess files at all: my pet peeve, quoted from from the manual on .htaccess files: You should avoid using .htaccess files ...


1

After following all of the suggestions above I looked at all the other sites hosted on the same server and found the problem was replicated across all the sites housed under my home directory, but not on any others. After that I ran find ~/ -type f -name ".htaccess" instead of just in my DocumentRoot (/home/nxad/public_html) directory and found a .htaccess ...


1

Requests processing The base rule to remember is: nginx serves a request with one location (you could emphase even more: and one location only). Read: http://nginx.org/en/docs/http/request_processing.html location matching Read: location documentation Based on your configuration, nginx will first match on the /blog prefix location, then on the \.php$ ...


1

It looks like your first virtual host points to the domain1 directory. Loading the IP, with those two virtual hosts in that order, would load the domain1 directory. To change that you can just swap the order they are listed in.


1

You can define a RewriteCond condition to exclude the sub path in the root htaccess. It will be something like this (not tested) ... # BEGIN W3TC Minify cache <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_URI} !^/sub RewriteRule ^[_0-9a-zA-Z-]+/wp-content/cache/minify/[0-9]+/w3tc_rewrite_test$ ...


1

The only way I can think of to make this cleaner while just being within Apache would be to use a RewriteMap. Pointing to a txt for the map replace will force you to do some terrible things to get around the fact that RewriteRule replaces the entire string and that you'll have to have a RewriteRule take place for each character in the string (replaced or ...


1

I have found some solution for #2: order deny,allow deny from 54. SetEnvIfNoCase Referer "^$" bad_user SetEnvIfNoCase User-Agent "^Wget" bad_user SetEnvIfNoCase User-Agent "http://www.bing.com/bingbot.htm" good_user SetEnvIfNoCase User-Agent "http://www.google.com/bot.html" good_user Deny from env=bad_user Allow from env=good_user Note the order deny, ...


1

Apache will try to find .htaccess files in every directory, but lost+found is usually readable by root only, so it can't even check if a file is there. One solution is to mount the disk somewhere else, move the data into a subdir of that mountpoint and then either symlink or bind-mount that subdir it into place. This way, lost+found isn't in the directory ...


1

The answer to your question is contained within the error message. The right thing to do in this case would be to smack whoever wrote that line, and make a list of each option specified. If it appears with a minus at all, put it in once with a minus. If it appears only bare or with a plus, put it in once with a plus. I believe you just want this: ...



Only top voted, non community-wiki answers of a minimum length are eligible