Tag Info

New answers tagged

0

This line: Checks to see if mod_rewrite is installed in apache and if it isn't then anything between the above line and... </IfModule> is ignored. This line: RewriteCond %{QUERY_STRING} http://www.google.com/humans.txt\? [NC] checks to see if the URL contains http://www.google.com/humans.txt right after the question mark and the casing ...


0

Before I have added any new resorts, what should I do with www.domain-name.co.uk/resort-name-a, 302 or 301... This is a temporary situation so you should not be using a 301 "Permanent" redirect. To be honest, I don't think you need (or should) do anything at all in this respect! This is presumably a new site, so there might not be anything indexed ...


2

It looks like that code was developed to stop bots probing humans.txt via query strings. Not Blocked: http://example.com/humans.txt Blocked: http://example.com/?some_path=http://www.google.com/humans.txt? There is plenty of online guides about blocking humans.txt additionally lots of websites explaining what does what, a lot of those rules in that block ...


1

about the images and CSS not displaying; If your URL gets rewritten to something like products/31 keep in mind that relative links inside the html are now relative to products/ even though the php script itself sits in the root. Because the html gets interpreted by the browser and the browser thinks you are in the products/ folder. You can use absolute urls ...


2

GoDaddy by default enables mod_deflate and globally sets the compression types on all packages purchased in the last few years. Only classic accounts require manual intervention. SOURCE Our Linux Web Hosting hosting accounts have mod_deflate enabled by default. This compresses all text type files requested from it. You can disable mod_deflate ...


3

You can do this by adding another condition. RewriteCond %{REQUEST_URI} !^/members [NC] RewriteCond %{REQUEST_URI} !^/activity [NC] RewriteRule ^(.*)/([0-9]+)/$ /$1/S$2/ [R=301,L] Or, sometimes simpeler, use the OR of a regex: RewriteCond %{REQUEST_URI} !^/(members|activity) [NC] RewriteRule ^(.*)/([0-9]+)/$ /$1/S$2/ [R=301,L] I've removed the .*$ ...


0

There is an answer on http://stackoverflow.com/questions/1726860/apache-authentication-redirect-on-failure-reliably Basically you send a html file as error document that does a redirect to your placeholder page: <Location "/protected"> AuthUserFile /path/to/users AuthName "This is protected area" AuthGroupFile /dev/null AuthType Basic ...


3

You can just add another RewriteCond directive: RewriteCond %{REQUEST_URI} !^/activity RewriteCond %{REQUEST_URI} !^/members RewriteRule ^(.*)/([0-9]+)/$ /$1/S$2/ [R=301,L] Multiple RewriteCond directives are AND'd together by default. The OR flag can be used if required. I've removed the NC flag - unless you specifically need a case-insensitive match. As ...


0

Try this RewriteEngine on RewriteCond %{http_host} ^example.com [NC] RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} /help RewriteRule . - [L] RewriteRule ^([^\]+)$ $1.html [NC,L] I added a condition to your .htaccess to check if the Requested URI contains /help ,then it will be ...


1

Okay. There is a mod_dir http://httpd.apache.org/docs/2.2/mod/mod_dir.html which provides for a trailing slash redirect. You might want to enable this to make your life a lot easier. It is the module LoadModule dir_module modules/mod_dir.so in your configuration- you may need to un-comment this out. This reduces half of the work. From there, you can add the ...


1

Turn off the cPanel redirect. Not sure what it is doing or how. But clearly it is not working right. Create an .htaccess file in your sub-domain root directory with: RewriteEngine on RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301] ...in it. Obviously change example.com to your domain name. That should do what you want. If you do not know where ...


0

I wasn't convinced this would work, but I've tested it and it does seem to. Quite simply: ^.{0}$ Where: ^ is the start of the match . is any character (except newline) {0} is precisely zero times $ is the end of the match


0

Try this: RewriteCond %{HTTP_HOST} ^mydomain\.com$ [NC,OR] RewriteCond %{HTTP_HOST} ^www\.mydomain\.com$ [NC] RewriteRule ^(.*)$ http://my-new-domain.com/$1 [R=301,L] Your RewriteRule from your question is fundamentally incorrect: RewriteRule ^/?$ "http\:\/\/domain1\.com\/\?parameter\=value" [R=301,L] My example is a typical blanket redirect that will ...


0

Try this in your Root/.htaccess RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^domainalias\.com$ [NC,OR] RewriteCond %{HTTP_HOST} ^www\.domainalias\.com$ RewriteRule ^(.*)$ http://www.maindomain.com/specific-url/ [R=301,NC,L]


0

If you're looking to redirect a user from an old domain to a new domain on a specific page, you can use this: ======= update ======== RewriteEngine On RewriteCond %{HTTP_HOST} ^(www\.)?domainalias\.com [NC] RewriteRule ^(.*)$ http://maindomain.com/specific-url/$1 [R,L] or RewriteEngine On RewriteCond %{HTTP_HOST} ^www.domainalias.com$ [NC] RewriteRule ...


0

This is easy to do, and the only piece of the puzzle missing is an SSL cert for olddomain.com. Forget the idea about IP addresses restricting you, this misunderstanding is the root cause of your issue. 'Domain Validated' (or DV) certificates are very inexpensive and available from multiple vendors for well under $10 USD. I have used cheapsslsecurity.com and ...


3

While it isn't impossible to host multiple secure sites on a single IP address, thanks to SNI and SAN, the redirect you're trying to do is impossible without one of the aforementioned solutions. In order to receive a redirect from https://www.olddomain.com, the browser must have already requested that URL using SSL/TLS, and is expecting an encrypted response ...


0

All page assets should use appropriate Etag headers My website runs on some external virtual server with Apache You can't realistically send ETag headers for your page assets (ie. static resources: images, scripts, css) using PHP as it would involve sending all the requests for these, otherwise static, resources through PHP which is only going to ...


2

In PHP, you can use the header function to specify a custom Etag as follows: $et="11111"; // any custom etag value header("ETag: \"".$et."\"",true); Just make sure when you update the webpage in question that the etag value is updated. If you don't want to do a manual etag update, you can use this code instead: $et=md5(time()); // 32-bit etag value ...



Top 50 recent answers are included