Tag Info

New answers tagged

1

It might be worth to check whether the caching happens on the client and not server-side. Firefox will cache any 301 (PERMANLTY moved)-redirecteds for a few days. Use 302 (temporary) redirect. To fix "old targets" you can set up an html page redirecting to another domain (e.g. without www) etc. to prevent firefox from using its cache.


0

You can add the following to the default apache configuration and these rules will apply to any site running in that server. <Location /wp-admin> Order Deny,Allow Allow from 192.168.1.0/24 Allow from 10.1.1.0/16 Deny from 192.168.1.1 Deny from all </Location>


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.


-1

If you wanted to add the www to this. You can use: RewriteEngine On RewriteCond %{HTTP_HOST} !^http://(www\.)?admin-domain\.com RewriteRule ^admin/.*$ - [F] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] Just remember, the referring agent can be spoofed. ;-)


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.


0

What you're looking for is not necessarily restricting wp-admin to localhost, but an ip filter. This is a common solution to brute force attacks. However depending on what you're experiencing, there are many approaches. You might want to read the WordPress codex (go to Limit Access to wp-admin by IP)


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 ...


0

This is the fix to my question, after doing alot of research on issues, I've found out that it was pretty straight forward: server { listen 127.0.0.1:80; server_name virjox www.virjox; root home/virjox/public_html; index index.php; log_not_found off; #access_log logs/virjox-access.log; charset utf-8; sendfile on; location ~ /\. { deny all; } location ...


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$ ...


0

mod_expires doesn't override Expires headers if they're already present from whatever originally generated them (dynamic app, proxy, etc)


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$ ...


0

Click on the Wamp Server icon (phpmyadmin) Select Apache Select Apache Modules Select rewrite_module Restart Your Wamp Server Run your program. If this not working there is problem with your .htaccess file.


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, ...


0

I was hoping to do this with Apache, but I did find a simple way with php. <?php echo $_SERVER["QUERY_STRING"]; // Given GET /foo/bar?query, output: query ?>


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: ...


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 ...


0

Header set X-Robots-Tag "noindex,nofollow" There is nothing wrong with that line, however you do have it within 3 IfModule's. Are you sure you have all 3 of these modules? <IfModule mod_fcgid.c> <IfModule mod_setenvif.c> <IfModule mod_headers.c> You might want to make sure you have all 3, or move the header set to another location ...


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 ...



Top 50 recent answers are included