Tag Info

New answers tagged

0

Use Round-robin DNS or a load balancer.


2

Try using the mod_expires syntax using something like this: <IfModule mod_expires.c> ExpiresActive On ExpiresByType image/jpg "access 2 week" ExpiresByType image/jpeg "access 2 week" ExpiresByType image/gif "access 2 week" ExpiresByType image/png "access 2 week" ExpiresByType text/css "access 2 week" ExpiresByType text/html "access 1 hour" ...


2

But the Official documentation clearly states it is used only for the RewriteRule directive. The docs don't say that it can only be used on the RewriteRule directive. The page you link to (which incidentally is specifically about the RewriteRule flags) simply states: Use of the [NC] flag causes the RewriteRule to be matched in a case-insensitive ...


0

Your logic appears to be reversed... you need to remove the OR flag at the end of the first RewriteCond directive. This looks like it should be an implicit AND: RewriteCond %{HTTP_USER_AGENT} !Version/[1-5] RewriteCond %{HTTP_USER_AGENT} !MSIE\ ([6-8]) In other words... if it's not Safari and it's not IE6-8 then proceed... If you OR these two conditions ...


2

First off the easiest one for www is this. RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^yourwebsite\.com$ [NC] RewriteRule ^(.*)$ http://www.yourwebsite.com/$1 [R=301,L] Now for some actual rewriting you should be able to use something like this. RewriteCond $1 !^(users) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d ...


2

Apache and Lighthttpd both have a directory listing mod that you need to enable, often by default these are disabled for security reasons. You can enable indexing by doing the following: Lighthttp To enable directory listings globally: dir-listing.activate = "enable" If you need it only for a directory, use conditionals: $HTTP["url"] =~ ...


2

You seem to have 2 A records for example.com pointing to very different IP addresses, one of which is the one that www.example.com resolves to (which is the wrong one). My guess is that it's picking the first one that it finds!?


3

For wamp 2.5 on Windows, use a text editor, e.g. notepad++ to edit c:\wamp\bin\apache\apache2.4.9\conf\httpd.conf Change DocumentRoot "c:/wamp/www" to DocumentRoot "c:/my/new/path" (Note slash direction). This will change the location where files are served from (~Line 230). Change <Directory "c:/wamp/www"> to <Directory "c:/my/new/path"> ...


1

There are many technical reasons for using www over no-www, the most obvious one is no-www's cookies are sent to all subdomains, which will slow down static content even if you use static. subdomain. More details here: http://www.yes-www.org/why-use-www/ As for why your no-www is really slow, it depends on many factors, your sysadmin got to diagnose it. ...


3

You're much better off doing a redirect from non-www to www. There is no need for canonical and no need for Javascript. If you have apache with mod_rewrite installed, then in the main apache configuration file, you can add these lines: RewriteEngine On RewriteCond %{HTTP_HOST} ^example\.com$ [NC] RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L] Of ...


3

If you're getting alot of requests with undefined added to the URLs and you know the things accessing those URLs are people and not robots, you're much better off using HTTP status code 301 and redirecting the URL to the correct one. Using status code 204 will not help because it means "No content" and the user will then need to manually modify the URL in ...


3

In order to match "undefined" at the end of the URL-path you need the regex pattern undefined$. The pattern ^undefined$ (which you've used in your question) matches the exact URL "undefined", which is never going to match, unless the request is for http://example.com/undefined. This directive should go at the top of your .htaccess file (after the ...



Top 50 recent answers are included