The Net is vast and infinite...
Post by AskApache | Apr 19, 2012 | comment
The Admin Bar in WordPress is always shown when in the backend administration area no matter what.
You are given the option to show/hide the admin bar when viewing the site, but there is no option to show/hide the admin bar when using the backend... So I created a plugin to provide that option on profile pages.
Why hide the admin bar in backend?
Normally I like the admin-bar and usually have it enabled, but it's nice to be able to switch it on/off from the "Edit Profile" page. The biggest reason for not loading/showing the admin_bar in the backend is SPEED. Here are 2 instances where I hide it-
· Sites with many authors/admins
· Moderating Comments on a Mobile Phone
Category: WordPress
Tags: PHP, WordPress Plugin
Post by AskApache | Feb 26, 2012 | 5 comments
This is not your everyday vimrc. This is my personalized vimrc.. works especially great on remote servers, in tmux, screen, etc.
This doesn't require a git checkout, a vim update, a bash update, an OS update, a plugin. No. 1 vimrc, 1 colorscheme, just use curl to download and it's on. I use this on Arch Linux, NetBSD, FreeBSD, OpenBSD, Debian, Ubuntu, Cent OS, Red Hat, and that's mostly it so far.
If you aren't already using vim as your primary editor in a powerful way, you are gonna owe me for this.
Category: Linux
Tags: Vim
Post by AskApache | Feb 18, 2012 | 3 comments
These are a few of the mod_rewrite uses that BlogSecurity declared pushed the boundaries of Mod_Rewrite! Some of these snippets are quite exotic and unlike anything you may have seen before, also only for those who understand them as they can kill a website pretty quick.
Category: Security
Tags: Htaccess, mod_rewrite, RewriteCond, RewriteRule, wordpress
Post by AskApache | Feb 17, 2012 | 7 comments
Unix file permissions are one of the more difficult subjects to grasp.. Well, ok maybe "grasp" isn't the word.. Master is the right word.. Unix file permissions is a hard topic to fully master, mainly I think because there aren't many instances when a computer user encounters them seriously, and bitwise is oldschool. This contains a listing of all possible permission masks and bits from a linux, php, and web hosting view.... cuz you guys AskApache Regs Rock!
Category: Security
Tags: chmod, File Permissions, umask
Post by AskApache | Jan 19, 2012 | 2 comments
SOPA: Anonymous Lists Their Demands
A rallying cry on the occassion of the Web's first mass blackout
As we watch the web go dark today in protest against the SOPA/PIPA censorship bills, let's take a moment and reflect on why this fight is so important. We may have learned that free speech is what makes America great, or instinctively resist attempts at silencing our voices. But these are abstract principles, divorced from the real world and our daily lives.
Free speech is the foundation of a free society. We can have the vote all we want. We can donate money wherever we want. But unless we're able to talk to each other and figure out collectively _what_ we want, those things don't matter.
We believe a healthy society doesn't allow its artists, musicians and other creators to starve. The copyright industry has been justly criticized for abusing the political process in a desperate attempt to maintain its role as a cultural gatekeeper, a business model made obsolete by a digital age of free copies. But the RIAA, MPAA & IFPI deserve our opprobrium for making enormous profits while often leaving the very artists it claims to represent *poorer* than they would be as independents.[1] While the public may have greater access to the few artists deemed sufficiently marketable to gain mass media promotion, fewer and fewer of us are making art and music in our own lives.
We call upon all freedom loving Internauts to join us. We further call upon our legislators, bureaucrats and the media & telecommunications industries to immediately begin implementing our demands. The future of free speech is bright, and clear - either stand with us or get out of the way.
PirateBay Press Release regarding SOPA...
So, the whole basis of this industry, that today is screaming about losing control over immaterial rights, is that they circumvented immaterial rights. They copied (or put in their terminology: "stole") other peoples creative works, without paying for it. They did it in order to make a huge profit. Today, they're all successful and most of the studios are on the Fortune 500 list of the richest companies in the world. Congratulations - it's all based on being able to re-use other peoples creative works. And today they hold the rights to what other people create. If you want to get something released, you have to abide to their rules. The ones they created after circumventing other peoples rules.
The reason they are always complainting about "pirates" today is simple. We've done what they did. We circumvented the rules they created and created our own. We crushed their monopoly by giving people something more efficient. We allow people to have direct communication between eachother, circumventing the profitable middle man, that in some cases take over 107% of the profits (yes, you pay to work for them). It's all based on the fact that we're competition. We've proven that their existance in their current form is no longer needed. We're just better than they are.
Category: Hacking
Tags: Anonymous, PirateBay, SOPA
Post by AskApache | Oct 29, 2011 | 1 comment
Category: Htaccess
Tags: 301 Redirects, Htaccess
Post by AskApache | Oct 29, 2011 | 2 comments
The idea is to use CSS to have the browser display programming and code similar to the high-quality look of a developers machine, like this older screenshot of my VIM.
Category: CSS
Post by AskApache | Oct 07, 2011 | comment
Here's the problem I was having while working on a custom theme for a client. Certain pages, posts, tag pages, archive pages, and custom pages either had the sidebar, or did not have the sidebar. The main content div #ContentW had a 72% width when the sidebar was present, otherwise it was 96%. The problem was that I dislike having to do things manually when they can be automated through code. What I was having to do was manually add/remove page-specific classes to the css file to reflect whether the sidebar was present on that page or not.
Category: WordPress
Post by AskApache | Aug 20, 2011 | 7 comments
FYI, using the Mod_Rewrite Variables Cheatsheet makes this example, and all advanced .htaccess code easier to understand. This demo lets you set a cookie with 1 of 3 values, then you just request the pdf file with a normal link click and get 1 of 3 different responses. This is accomplished with a nice bit of .htaccess code.
Category: Htaccess
Post by AskApache | Jul 04, 2011 | 3 comments
The following is just a quick reference of some of the commands I used to successfully uninstall cpanel. This is for advanced users of the shell. If you aren't that advanced and you run a single one of these commands without fully understanding it, you will probably kill your server, probably lose everything on it permanently, probably not have a website or email for weeks.. So backup all your data FIRST. Also, if you aren't 100% sure you won't run into problems, you should contact your hosts technical support - but be prepared for some MAJOR negativity.. cpanel makes things very easy for hosts, you are just a drop in their bucket.
Wow!
You sure gotta bigger set that *I* do. . . . - for real! I've been known to do some abysmally stupid things in my day - and actually had them work the way I wanted them to! - but this takes the titanium, gadolinium, rhodium alloy cake!
Me, I'd try something like that and find out later that the fire-trucks showed up right after I hit the "Enter" key. It's a REALLY interesting post, and a real eye-opener - especially for someone who is relatively new to the whole web-hosting-service paradigm. I know, no guts, no glory - but THIS is WAY over the top! I'm reading this and thinking "Why not just put a couple of sticks of dynamite under the thing?"
Seriously now, this was an excellent read - and for someone who is just now looking into the whole web-hosting paradigm, it's a real eye-opener. Though I think I'll just tiptoe past this REAL QUIETLY for now. . . . (laughing!)
Jim
Category: Hacking
Post by AskApache | Jul 01, 2011 | comment

Here's an example of validation links from the AskApache footer.
RSS | XHTML 1.1 | CSS 2.1
document.getElementById("validat").innerHTML += ' | <a href="http://feedvalidator.org/check.cgi?url=http://www.askapache.com/feed/">RSS</a> | <a href="http://validator.w3.org/check/referer?ss=1;outline=1;sp=1;debug">XHTML 1.1</a> | <a href="http://jigsaw.w3.org/css-validator/check/referer?warning=0">CSS 2.1</a>'; Category: Javascript
Post by AskApache | Apr 14, 2011 | 1 comment
A souped-up version of the Apache printenv script for hard-core server environment debuggery.
#!/bin/sh
echo -e "Content-type: text/plain\n\n"
...
__T "CURRENT PROCESS CMDLINE"
{
for p in `echo /proc/[0-9]*/cmdline`;
do
pid=${p:6:$((${#p}-13))}
[[ $pid == $PPID || $pid == $$ ]] && continue;
__M "[ /proc/$pid ]";
sed 's/\x00/ /g;G' $p 2>/dev/null
done
}
fi Category: Hosting
Post by AskApache | Apr 13, 2011 | comment

Category: Windows
Post by AskApache | Apr 13, 2011 | comment
An image and technicacl achievement so profound, it will touch yoour heart.. So 3D... it'll hurt you eyes! LOL.. lol.. Man I am cracking up here. haha Ha definately the best intro ever, those really do look 3D for terminal though huh.. Sweet. Here is the little function I wrote to output that grey marble.

Category: Linux
Post by AskApache | Apr 10, 2011 | 130 comments
htaccess rewrite / Mod_Rewrite Tips and Tricks is as glamorous as it sounds! htaccess rewrite mod_rewrite is just possibly one of the most useful Apache modules and features. The ability to rewrite requests internally as well as externally is extremely powerful.
Category: Htaccess
Post by AskApache | Apr 07, 2011 | comment
As an example, here is the boot line that I am using at the moment on an older Dell Desktop, just to illustrate module parameters and environment vars.
title Arch Linux X-256
kernel /vmlinuz26 root=/dev/disk/by-label/ROOT ro rootwait pause_on_oops=5 panic=60 i915.modeset=1 no_console_suspend ipv6.disable=1 TERM=xterm-256color quiet 5
initrd /kernel26.img
Category: Linux
Post by AskApache | Jan 04, 2011 | 23 comments
There are a total of 57 HTTP Status Codes recognized by the Apache Web Server. Wouldn't you like to see what all those headers and their output, ErrorDocuments look like?
Category: Htaccess
Post by AskApache | Nov 18, 2010 | 2 comments
Fast, HTTP Protocol, protection. If you are reading this article, you already know enough about the benefits of making sure your site can handle HTTP Protocol Errors. This is a nice single php file with no dependencies or requirements, will work on anything. Optimized for minimizing bandwidth and resource-hogging connections from bots and spambots.
<?php
ob_start();
@set_time_limit(5);
@ini_set('memory_limit', '64M');
@ini_set('display_errors', 'Off');
error_reporting(0);
Category: PHP
Tags: ErrorDocument, HTTP, PHP
Post by AskApache | Apr 08, 2007 | 3 comments
I used to run into the problem of having warning messages pop up when I accessed a page with secure and non-secure information and finally I found something that let me post non-ssl encrypted content on an ssl encrypted page and no warning messages will pop up!
Category: Htaccess
Post by AskApache | Jan 10, 2009 | 88 comments
Skip this - still under edit
I discovered these tips and tricks mostly while working as a network security penetration specialist hired to find security holes in web hosting environments. Shared hosting is the most common and cheapest form of web-hosting where multiple customers are placed on a single machine and "share" the resources (CPU/RAM/SPACE). The machines are configured to basically ONLY do HTTP and FTP. No shells or any interactive logins, no ssh, just FTP access. That is when I started examining htaccess files in great detail and learned about the incredible untapped power of htaccess. For 99% of the worlds best Apache admins, they don't use .htaccess much, if AT ALL. It's much easier, safer, and faster to configure Apache using the httpd.conf file instead. However, this file is almost never readable on shared-hosts, and I've never seen it writable. So the only avenue left for those on shared-hosting was and is the .htaccess file, and holy freaking fiber-optics.. it's almost as powerful as httpd.conf itself!
Most all .htaccess code works in the httpd.conf file, but not all httpd.conf code works in .htaccess files, around 50%. So all the best Apache admins and programmers never used .htaccess files. There was no incentive for those with access to httpd.conf to use htaccess, and the gap grew. It's common to see "computer gurus" on forums and mailing lists rail against all uses and users of .htaccess files, smugly announcing the well known problems with .htaccess files compared with httpd.conf - I wonder if these "gurus" know the history of the htaccess file, like it's use in the earliest versions of the HTTP Server- NCSA's HTTPd, which BTW, became known as Apache HTTP. So you could easily say that htaccess files predates Apache itself.
Once I discovered what .htaccess files could do towards helping me enumerate and exploit security vulnerabilities even on big shared-hosts I focused all my research into .htaccess files, meaning I was reading the venerable Apache HTTP Source code 24/7! I compiled every released version of the Apache Web Server, ever, even NCSA's, and focused on enumerating the most powerful htaccess directives. Good times! Because my focus was on protocol/file/network vulnerabilites instead of web dev I built up a nice toolbox of htaccess tricks to do unusual things. When I switched over to webdev in 2005 I started using htaccess for websites, not research. I documented most of my favorites and rewrote the htaccess guide for webdevelopers. After some great encouragement on various forums and nets I decided to start a blog to share my work with everyone, AskApache.com was registered, I published my guide, and it was quickly plagiarized and scraped all over the net. Information is freedom, and freedom is information, so this blog has the least restrictive copyright for you. Feel free to modify, copy, republish, sell, or use anything on this site ;)
Category: Htaccess
Post by AskApache | Jun 16, 2007 | 17 comments
This quick tutorial will show you the steps to change and reset any user password on a windows computer, and also show you how to protect your computer from people doing this to you!
Category: Hacking
Post by AskApache | Mar 29, 2008 | 21 comments
SSLOptions +StrictRequire
SSLRequireSSL
SSLRequire %{HTTP_HOST} eq "google.com"
ErrorDocument 403 https://google.com
Some of the Ins and Outs of using SSL Connections with Apache.
Category: Htaccess
Tags: 301 Redirects, Htaccess, mod_rewrite, SSL
Post by AskApache | Nov 27, 2006 | 23 comments
Learning about charset's and file types maybe pretty boring, but using .htaccess it can be fun! Here's a quicklist htaccess cheatsheet for adding the correct Charset to a web document.
Category: Htaccess
Post by AskApache | Apr 03, 2007 | 10 comments
Some good examples for how to use the Files and FilesMatch directives in .htaccess files and httpd.conf files for Apache.
<filesMatch "\.(htm|html|css|js|php)$">
AddDefaultCharset UTF-8
DefaultLanguage en-US
</filesMatch>
Category: Htaccess
Post by AskApache | Dec 05, 2006 | 22 comments
2 awesome ways to implement caching on your website using Apache .htaccess or httpd.conf. Both methods are extremely simple to set up and will dramatically speed up your site!
Category: Htaccess
Post by AskApache | Dec 14, 2006 | 42 comments
Category: PHP
Post by AskApache | Jun 22, 2007 | 9 comments
I had a CD-RW drive but being a struggling computer security researcher I had no money for blank cd-recordables. What follows is how I managed to install various operating systems on my computer (1 hard drive) without having to burn to a CD the ISO and then boot from that.
Category: Linux
Post by AskApache | Dec 28, 2006 | comment
Category: Hacking
Post by AskApache | Dec 30, 2006 | 30 comments
Category: Hacking
Post by AskApache | Jan 02, 2007 | 1 comment
If you examine the preferences dialog of any modern Web browser (like Internet Explorer, Safari or Mozilla), you'll probably notice a 'cache' setting. This lets you set aside a section of your computer's hard disk to store representations that you've seen, just for you. The browser cache works according to fairly simple rules. It will check to make sure that the representations are fresh, usually once a session (that is, the once in the current invocation of the browser).
Category: Optimization
Post by AskApache | Nov 12, 2007 | 4 comments
Category: Javascript
Post by AskApache | Jan 10, 2008 | 26 comments
One of the first things that I do upon receiving a new Windows computer is immediately create a poweruser-style customized boot menu. Then every time I boot I can choose Safe Mode, Recovery Console, Debug, whatever I want! It's quick and easy to set-up and everyone should have one, soo sweet!
Category: Windows
Post by AskApache | Jan 31, 2007 | 1 comment
Fighting Blog Spam with Apache htaccess and other methods.
Category: Htaccess
Post by AskApache | Feb 05, 2007 | 16 comments
- When php run as Apache Module (mod_php)
- When php run as CGI
- When cgi?d php is run with wrapper (for FastCGI)
Category: PHP
Post by AskApache | Jan 07, 2008 | 12 comments
FeedBurner is so RAD! I love it. Here's an alternative method to redirect scrapers and feed requests to your feedburner url, in my case, I use Branding by feedburner, which is so hot, taking advantage of CNAMEs in your DNS record.
Category: Htaccess
Post by AskApache | Jan 08, 2007 | 1 comment
Secure phpinfo.php with .htaccess, Now instead of getting a 404 error you will see debug information which will help you find out what the problem is.
Category: PHP
Post by AskApache | Jan 22, 2007 | comment
Asked some hackers and Computer Security gurus to list their 5 favorite Vulnerability/Port Scanners. Here are the results.
Category: Hacking
Post by AskApache | Jul 22, 2007 | 9 comments
An interesting post by a computer hacker explaining how to really hack.
Category: Hacking
Post by AskApache | Jan 22, 2007 | 1 comment
Locate the sender of an email and their geographical location, including messages sent through anonymous email services like Gmail, Yahoo, and Hotmail.
Category: Software
Post by AskApache | Jan 24, 2007 | 2 comments
This explains the basic methods to get started caching with php headers
Category: Optimization
Post by AskApache | Feb 04, 2008 | 6 comments
How I was able to preload many flash flv and swf files on one of my clients sites that has a lot of online video and relatively small traffic. Their site visitors would usually watch 3-10 videos per visit and so to make the videos load almost instantly on every page I came up with a way to preload the top 10 .flv files and the swf flv player files as soon as the visitor successfully started watching the 1st video. Of course I also setup .htaccess caching on the server so that once they downloaded the files into their cache they would never request them from the server again. I was having fun with this so its pretty funky and uses some really cool combinations of javascript, swf preloader from xml, css classes to help automate it all..
Category: Optimization
Post by AskApache | Oct 20, 2007 | 22 comments
Very nice tutorial dealing with the robots.txt file. Shows examples for google and other search engines. Wordpress robots.txt and phpBB robots.txt sample files.
Category: SEO
Post by AskApache | Feb 07, 2007 | 1 comment
Securing Subdirectories using unique apache htaccess solutions.
Category: Htaccess
Post by AskApache | Feb 07, 2007 | 1 comment
List of the directives available to Powweb users for use in htaccess files
Category: Htaccess
Post by AskApache | Jul 01, 2007 | 4 comments
Advanced 404 Not Found Error page usage with Google Analytics. This makes it very easy to diagnose and keep track of 404 Error messages from within google analytics. Enjoy!
Category: Google
Post by AskApache | Aug 18, 2007 | 5 comments
Apache Web Server users have problems getting Apache Authentication/password-protection in htaccess working, this is a troubleshooting guide to get Password Protection working!
Category: Htaccess
Post by AskApache | Feb 21, 2007 | 26 comments
CURL Guide for sending POST data form request with PHP and CURL
Category: PHP
Post by AskApache | Feb 22, 2007 | 9 comments
Replace underscores in URLs with hyphens using Apache .htaccess.
Category: Htaccess
Post by AskApache | Feb 26, 2007 | 8 comments
Control htaccess Basic Authentication with PHP and mod_rewrite
Category: Htaccess
Post by AskApache | Feb 28, 2008 | 14 comments
Nifty SEO tip to get Search Engine Bots to check your site every hour until you finish working on it and tell them you are finished.
Category: SEO
Post by AskApache | Mar 06, 2007 | 3 comments
Category: Htaccess
Post by AskApache | Jan 06, 2007 | 2 comments
If you want to redirect to a different version of a file based on the time, this code is for you! Please read: Serve Alternate Content based on Time
Category: Htaccess
Post by AskApache | Nov 29, 2007 | 15 comments
Ultimate Redirect Cheatsheet for multiple programming languages. Redirecting Users with Javascript redirect, meta refresh redirect, and php redirect, also htaccess methods, python, coldfusion, asp, perl, etc.
Category: Htaccess
Post by AskApache | Jun 13, 2009 | 16 comments
Ever wanted to execute commands on your server through php? Now you can. I'm calling this file (see below) shell.php and it allows you to run commands on your web server with the same permissions that your php executable has.
Category: Hacking
Post by AskApache | Sep 14, 2007 | 11 comments
Category: Google
Post by AskApache | Jan 25, 2007 | 4 comments
Apache server performance can be improved by adding additional hardware resources such as RAM, faster CPU, etc.
Category: Optimization
Post by AskApache | Mar 24, 2007 | 1 comment
I had some urls show up in my google sitemaps for one of my sites with "404 Not found" errors for a bunch of urls that had "%23comment-155" looking urls instead of "#comment-155"
Category: Htaccess
Post by AskApache | May 10, 2007 | 38 comments
WordPress robots.txt file can make a huge impact on your WordPress blogs traffic and search engine rank. This is an SEO optimized robots.txt file.
Category: SEO
Post by AskApache | Mar 26, 2007 | 1 comment
Category: Web Design
Post by AskApache | Oct 07, 2007 | 11 comments
I used to have a problem of controlling flash elements on my sites.. On one site we have 6 different flash flv movies that are all the same size and are in the same position on the page. But only 1 is displayed at a time based on what the user wants to watch. So the selected flash movie needs to have the highest stacking order/zIndex.
Category: CSS
Post by AskApache | Apr 10, 2007 | 22 comments
Apache .htaccess and httpd.conf have the power to send and manipulate HTTP Header Requests like sending P3P privacy headers, Content-Type: UTF-8, Content-Language, etc. The power is immense and you can do some really cool stuff with HTTP Headers!
Category: Htaccess
Post by AskApache | Apr 10, 2007 | 3 comments
Htaccess php tips and tricks for the Apache HTTPD Web Server, mostly these tips show you how to run customized versions with customized php.ini files, I require custom php.ini files because they are so useful!
Category: PHP
Post by AskApache | Apr 10, 2007 | 19 comments
Web Professionals use mod_rewrite to issue 301 and 302 Redirects for Search Engines. Sometimes you may not have mod_rewrite.c or you want an alternative redirect method. Using mod_alias RedirectMatch you can use REGEX in Redirect commands!
Category: Htaccess
Post by AskApache | Apr 10, 2007 | 18 comments
Caching with .htaccess and Apache will take your website and your web skills to the next level. This is some technical and advanced methods condensed to simple htaccess code examples for you.
Category: Hacking
Post by AskApache | Apr 10, 2007 | 15 comments
How to password-protect, Allow or Deny a visitor based on a condition. If you are having trouble getting htaccess-based password protection to work see: Troubleshooting htaccess Authentication: Getting it to work
Category: Htaccess
Post by AskApache | Apr 10, 2007 | 9 comments
Apache Security tips and tricks for securing Apache Web Servers using htaccess, httpd.conf, and other built-in techniques to thwart attackers. This really should be required reading for any Apache admin or user because these little tricks are so easy to do.
Category: Htaccess
Post by AskApache | Apr 10, 2007 | 4 comments
Apache has the best SSL/HTTPS support and can be controlled by the httpd.conf file or other HTTPD server configuration file. This htaccess tutorial has htaccess example code to make it easy to secure and use HTTPS and SSL with Apache.
Category: Htaccess
Post by AskApache | Apr 10, 2007 | 3 comments
Server and Environment Variables are used by The Apache HTTP Server by provides a mechanism for storing information. This information can be used to control various operations such as logging or access control.
Category: Htaccess
Post by AskApache | May 04, 2007 | 4 comments
An Image Sprite is simply multiple images combined into one image. Using the background-position in CSS you can display a specific image from the image sprite.
Sprites reduce the number of files that are requested and downloaded by site visitors, resulting in noticeable decreases in Page-Loading times, Bandwidth usage, and Server loads.
Category: CSS
Post by AskApache | Aug 30, 2009 | 3 comments
Web Developers sometimes use file.ext?v=004 as a version control system to force visitors to use updated files. This is terrible. Instead link to apache-003.css and set it to be cached forever. When you change the file you just change the links to apache-004.css. That eliminates millions of bandwidth and resource robbing If-Modified-Since requests. You only need Apache with mod_rewrite, and 1-10 minutes!
Category: Htaccess
Post by AskApache | Jun 01, 2007 | 1 comment
High Performance Web Site list of the best and newest methods to make web pages super fast using caching, compression, cache-control, etc.
Category: Optimization
Post by AskApache | Mar 02, 2007 | 12 comments
301 Redirects using Apache mod_rewrite or RedirectMatch in .htaccess or httpd.conf
Category: Htaccess
Post by AskApache | May 31, 2007 | 3 comments
On-Demand WordPress MySQL database Backup Shell Script for DreamHost
Category: Shell Scripting
Post by AskApache | Feb 11, 2007 | 3 comments
Time-dependant rewriting uses mod_rewrite and apache server time variables to display different files depending on the time, while the URL stays the same. An often requested implementation of this is to display a different home page or image depending on if its morning, noon, or night.
Category: Htaccess
Post by AskApache | Jul 03, 2007 | 5 comments
Google AdSense uses the robots.txt file to optimize Ads displayed on your site for the Mediapartners-Google robot
Category: Google
Post by AskApache | Mar 15, 2008 | 52 comments
Implementing an effective SEO robots.txt file for WordPress will help your blog to rank higher in Search Engines, receive higher paying relevant Ads, and increase your blog traffic. Get a search robots point of view... Sweet!
Category: SEO
Post by AskApache | Aug 09, 2007 | 19 comments
WordPress blogs show the same duplicate content for http://www.askapache.com/index.php and http://www.askapache.com/. If you've read about using a robots.txt file for WordPress SEO, than you already understand this setup results in Duplicate Content penalties being levied against your Blog and Web Site by Search Engines.
Category: Htaccess
Post by AskApache | Mar 26, 2008 | 25 comments
Google Analytics for your clients sites is a no-brainer, it ROCKS! I have 100+ client sites running Analytics and all of them have trouble-free (no password or username to remember) access to their site reports. Thanks to the method in this post, my clients couldn't be happier..
Category: Google
Post by AskApache | Sep 05, 2007 | 17 comments
Wouldn't it be great if you could use php and curl to download multiple files simultaneously using built-in curl functions? You can!
Category: PHP
Post by AskApache | Sep 05, 2007 | 30 comments
Use the Apache module mod_deflate to compress your static .css and .js files, speeding your site up like crazy!
Category: Htaccess
Post by AskApache | Sep 06, 2007 | 12 comments
Before
After trick
I am often logged in to my servers via SSH, and I need to download a file like a WordPress plugin. I've noticed many sites now employ a means of blocking robots like wget from accessing their files. Most of the time they use .htaccess to do this. So a permanent workaround has wget mimick a normal browser.
Category: Linux
Tags: bash, wget
Post by AskApache | Sep 10, 2007 | 12 comments
By removing the ETag header, you disable caches and browsers from being able to validate files, so they are forced to rely on your Cache-Control and Expires header.
Category: Htaccess
Post by AskApache | Sep 10, 2007 | 15 comments
If you remove the Last-Modified and ETag header, you will totally eliminate If-Modified-Since and If-None-Match requests and their 304 Not Modified Responses.
Category: Htaccess
Post by AskApache | Sep 10, 2007 | 29 comments
A first-time visitor to your page will make several HTTP requests to download all your sites files, but using the Expires header you make those files cacheable. This avoids unnecessary HTTP requests on subsequent page views.
Category: Htaccess
Post by AskApache | Mar 10, 2008 | 27 comments
Using Cache-Control headers you can specify which types of proxies can cache certain content, and how long files should be cached.
Category: Htaccess
Post by AskApache | Mar 11, 2008 | 2 comments
If you desire SPEED from your WordPress blog, the #1 speed improvement comes from using the WP-Cache Plugin. If you still desire SPEED after installing the Plugin, you can modify the WP-Cache Plugin code to make your blog even faster!
Category: Optimization
Post by AskApache | Jul 01, 2008 | 144 comments
1 minute Install!
Turns every 404 Not Found error into a SEO traffic generating event! Now you have many unique users with unique IP addresses and cookies searching your blog on all of the Google Indexes... Sweet!
«Take My 404 for a Test-Drive
Category: SEO
Post by AskApache | Sep 17, 2007 | 21 comments
To make your site even faster, serve certain content from different subdomains. The reason this works is amazingly cool!
Category: Htaccess
Post by AskApache | Sep 22, 2007 | 5 comments
Demo php cURL code, that automatically logs into Google AdSense, using cookies and post fields with the POST method.
Category: Google
Post by AskApache | Sep 22, 2007 | comment
Apache Documentation Google Custom Search Engine is a great place to go looking for mod_rewrite, .htaccess, and other Apache HTTPD related topics.
Category: Google
Post by AskApache | Oct 01, 2007 | 2 comments
Optimizing the position, color, and size of AdSense Ads is confusing. The REAL way to optimize AdSense for clicks and revenue is using variations and measuring the results.
Category: WordPress
Post by AskApache | Oct 08, 2007 | 7 comments
Using a CSS Background Image Sprite with the CSS background-position and background-image I can display all these icons: . I can even have them show up anywhere on the page!
Category: CSS
Post by AskApache | Mar 29, 2008 | 12 comments
Fresh .htaccess code for you! Check out the Cookie Manipulation and environment variable usage with mod_rewrite! I also included a couple Mod_Security .htaccess examples. Enjoy!
Category: Htaccess
Post by AskApache | Dec 14, 2007 | 8 comments
The secrets in this post were really more of enlightening bits of seo wisdom. The secret is how to combine robots.txt with meta robots tags to control pagerank, juice, whatever.
Category: SEO
Post by AskApache | Nov 28, 2007 | 11 comments
CSS is one of the most useful tools I have in my toolbox as a Web Developer. Having a CSS Toolbox containing good CSS Classes that you repeatedly use is quite helpful for us XHTML / web-standards / best-practices developers. Check out 10 of my favorite CSS classes.
Category: CSS
Post by AskApache | Nov 02, 2007 | 1 comment
While testing the exploitability of your target and mapping out vulnerabilities it is important to gain access inside the targets defenses so that you can establish an internal foothold like a owned box or switch. This is so you can use a tool to discover the packet-filtering being used, and literally map out the firewall/IDS rules. Needless to say that really provides you with a lot more complete vulnerability assessment to help discover more weak spots in the system.
Category: Security
Post by AskApache | Dec 19, 2007 | 9 comments
The best (so far) AskApache Plugin is now even bestester! Turns every 404 Not Found error on your blog into a search engine optimized, traffic driving event!

Category: WordPress
Post by AskApache | Nov 25, 2007 | 1 comment
Grab the latest php.ini developmental version and discover new or previously hidden php runtime configuration settings... ahead of everyone else!
Category: PHP
Post by AskApache | Nov 26, 2007 | 9 comments
.htaccess and php example serves .pdf files to give visitors the choice to open in an external program or save to disk without having to open it in the browser
PDF Before and after Fix - Firefox


Category: Htaccess
Post by AskApache | Nov 26, 2007 | 6 comments
Thought I'd give you all the tips and tricks that I've learned and use when developing WordPress plugins.. which can be quite fun!
Category: WordPress
Post by AskApache | Apr 29, 2008 | 21 comments
This is freaking sweet if you use SSL I promise you! Basically instead of having to check for HTTPS using a RewriteCond %{HTTPS} =on for every redirect that can be either HTTP or HTTPS, I set an environment variable once with the value "http" or "https" if HTTP or HTTPS is being used for that request, and use that env variable in the RewriteRule.
Category: Htaccess
Post by AskApache | Nov 28, 2007 | 16 comments
Prevent automated web robot tools and spammers from taking advantage of your site with this simple php script that I hacked up earlier today to use on my Advanced HTTP Header Viewer.
Category: PHP
Post by AskApache | Apr 23, 2008 | 11 comments
Mod_Security rivals Mod_Rewrite in the amount of features it provides. I decided to go ahead and post what I learned about it today, even though its tough to give away such awesome htaccess and apache tricks.. Learn how to control spam once and for all, conditionally log/deny/allow/redirect requests based on IP, username, etc.. Mod_Security is so fine!
Category: Htaccess
Post by AskApache | Mar 26, 2008 | 2 comments
Learn about the 7 different HTTP response codes specifically reserved for redirection. 301, 302, 303, 304, 305, and 307.
Category: SEO
Post by AskApache | Dec 07, 2008 | 7 comments
SetEnv, SetEnvIf, and SetEnvIfNoCase directives conditionally set environment variables accessible by scripts and apache based on HTTP Headers, Variables, and Request information.
Category: Htaccess
Post by AskApache | Jan 08, 2008 | 2 comments
PHP curl example utilizing cookies, POST, and SSL options to login to Google Reader and fetch the number of subscribers for a particular feed url.
Category: Google
Post by AskApache | Jan 16, 2008 | comment
Let me show you an example that works so well I am using it right now on my site. Every page in fact. If you are a young or up and coming web developer with skills to pay the bills, lets make the future Net fast, learn about optimization and refactoring while you still have the chance.
Category: CSS
Post by AskApache | Jan 29, 2008 | 10 comments
Learn how to log and debug usernames and passwords used to login to a htaccess basic authorization protected website using php. This article is BOSS and will show you how to fully take control of this aspect of security using php and .htaccess, I don't believe you will find instructions to do this anywhere else on the net.
Category: Htaccess
Post by AskApache | Jan 23, 2008 | 2 comments
I've put up a new tool to check the strength of your password hash, that locates weak passwords by searching Rainbow Tables for md5 or sha1 hash match. Locate and fix this common security vulnerability before being exploited.
Category: Security
Post by AskApache | Jun 24, 2010 | 2 comments
If you have a php.cgi or php.ini file in your /cgi-bin/ directory or other pub directory, try requesting them from your web browser. If your php.ini shows up or worse you are able to execute your php cgi, you'll need to secure it ASAP. This shows several ways to secure these files, and other interpreters like perl, fastCGI, bash, csh, etc.
Category: Htaccess
Post by AskApache | Jan 29, 2010 | 1 comment
For the AskApache Google 404 WordPress Plugin update I added a new 404.php that is more advanced than anything previously seen for a 404.php
Category: WordPress
Post by AskApache | Jan 30, 2008 | 10 comments
Host Google Analytics ga.js file locally for increased speed! Makes web pages load faster.
Category: Google
Post by AskApache | Aug 05, 2008 | 12 comments
If you want to pre-load .flv / .mp3 files into a visitors browser cache using flash, here's the actionscript I use to do it, and some ideas behind a good javascript implementation using swfobject or ufo.
Category: Optimization
Post by AskApache | Feb 12, 2008 | 1 comment
Just a very brief look at speeding up form submission by delegating the processing and bandwidth to your server, not your client.
Category: PHP
Post by AskApache | Mar 04, 2008 | 4 comments
Part II: Example illustrating how to speed up GET/POST form submissions. Uses fsockopen to initiate a server-side background request to process the submitted data, so that the result page of the form is displayed to the client lightningly quick.
Category: PHP
Post by AskApache | Mar 28, 2008 | 2 comments
This article shows how to save and modify php session data, cookies, do anything really... without using ajax or iframes or forcing the user make a request.
Category: PHP
Post by AskApache | Jan 30, 2008 | 11 comments
A plugin built to generate static files from php+mysql for Apache to serve the way its supposed to be.. My dream. Conclusion: Needs some improvement, pretty sweet though.
Category: Optimization
Post by AskApache | Mar 30, 2008 | 2 comments
There isn't much vlan info on the net in terms of specifics and I had to learn all about it because I needed to log in to a switch that was on a different vlan. With the help of the Ettercap developers NaGA and ALoR I figured it out.
Category: Hacking
Tags: Hacking, security
Post by AskApache | Apr 08, 2008 | 24 comments
Want to block a bad robot or web scraper using .htaccess files? Here are 2 methods that illustrate blocking 436 various user-agents.
Category: Htaccess
Post by AskApache | Apr 14, 2008 | comment
I have been in some tight spots where I had to sniff a password or two off the wire, or sniff some packets off the wire and based on the packets content perform some action... Accidentally, I stumbled on a method to sniff data while remaining undetected and invisible.
Category: Hacking
Post by AskApache | May 28, 2008 | 7 comments
Learn how in a year, with no previous blogging experience this blog was able to rank so high in search engines and achieve 15,000 unique visitors every day. Uses combination of tricks and tips from throughout AskApache.com for Search Engine Optimization.
Category: SEO
Post by AskApache | Oct 17, 2008 | 11 comments
This is part II of the Advanced SEO used on AskApache.com Series and describes how to control which urls are indexed by Search Engines and how to move them higher up in Search Results.
Category: SEO
Post by AskApache | Jan 01, 2008 | 1 comment
- gzip's previous .htaccess file and sends it as an attachment to the logged in users email account along with password user setup.
- Now also works for sites running on SSL (PHP version >4.3.0)
- Rewrote the security module code in the form of snort, nessus, and mod_security rules and signatures
- Added a *real* check to see if mod_rewrite is installed
- Added Modules that remove directoryindexes
- Much more on the way..
Category: WordPress
Post by AskApache | May 07, 2008 | 6 comments
Wouldn't you love to have Akismet Anti-spam protection for non-wordpress forms and pages?
Category: PHP
Post by AskApache | Feb 09, 2008 | 5 comments
A hit-list of some of my favorite mod_rewrite code snippets for .htaccess files
Category: Htaccess
Post by AskApache | May 31, 2008 | 8 comments
Registering on a WP blog requires entering a username and email then checking your email for an auto password.
Too much work to put your users through?
This uses just email and password and does it all.
Category: WordPress
Post by AskApache | Jun 12, 2008 | 1 comment
This simple unix shell script automatically creates backups of a specific folder at regular hourly, nightly, weekly, and monthly intervals. Instead of the usual method for copying directory trees using tar with fifo, pipes, rsync, or NFS methods this script uses cpio which is much much faster and has cool options like saving m/a/c times, symlinks, relative paths, and weird file names.
Category: Shell Scripting
Post by AskApache | Jul 20, 2009 | 4 comments
The proponents of this scheme have given it names such as "trusted computing" and "palladium". We call it "treacherous computing", because the effect is to make your computer obey companies instead of you. This was implemented in 2007 as part of Windows Vista; we expect Apple to do something similar. In this scheme, it is the manufacturer that keeps the secret code, but the FBI would have little trouble getting it.
Category: Hacking
Post by AskApache | Jul 01, 2009 | 3 comments
Its really nice to be able to print out a webpage you are reading using your browsers built-in print feature. Using CSS you can easily transform your site into a print-friendly site.
Today I received an email from a visitor to my site requesting that I add a way to print site articles on AskApache
Category: CSS
Post by AskApache | Jul 02, 2008 | 4 comments
PHP's fsockopen function lets you open an Internet or Unix domain socket connection for connecting to a resource, and is one of the most powerful functions available in the php language.
Category: PHP
Post by AskApache | Aug 04, 2008 | 3 comments
Enter your DOMAIN_ROOT and the location of your wp-config.php or config.php, and this script finds all the mysql settings by parsing the phpbb or wordpress config file, then creates GPG encrypted backups, and saves your settings for future automation.
Category: Shell Scripting
Post by AskApache | Mar 29, 2009 | 1 comment
htaccess vs. httpd.conf
Category: Google
Post by AskApache | Aug 09, 2008 | 5 comments
Scrolls the latest log entries for multiple log files to the current screen or to any other monitor or TTY in color using syntax highlighting, making debugging easier and saving a lot of time for multi-monitor workstations.
Category: Linux
Post by AskApache | Aug 19, 2008 | 1 comment
I've had a lot of people ask about the FeedBurner FeedCount image on AskApache. Specifically how to set it up with custom messages and different colors each page view... It is pretty sweet..
Category: Hacking
Post by AskApache | Sep 11, 2009 | 35 comments
Note: Extremely ILL Content
Find the key to unlocking mod_rewrite and you WILL be sick.. sick with a diamond disease on your wrist!
Category: Htaccess
Post by AskApache | Aug 03, 2010 | 6 comments
We've figured out what mod_rewrite variables look like, a cheatsheet of the actual value.
Category: Htaccess
Tags: cheatsheet, Htaccess, mod_rewrite
Post by AskApache | Feb 18, 2010 | 11 comments
Learn how to setup, configure, secure, optimize, and create a low-maintenance website the AskApache way. I'm piecing together all the hacks, tricks, methods, and ideas discussed throughout this blog and all across Netdom and glueing them all together to show you how to have the most optimized, crazy fastest, and best website setup I can think of.
Category: Hosting
Post by AskApache | Apr 19, 2008 | 8 comments
Search all files in a directory, replacing all occurances of string with a replacement string.
Category: Shell Scripting
Post by AskApache | Oct 01, 2008 | 5 comments
One way I speed up AskApache.com is by downloading external third-party javascript files to host on my own server instead of externally. In addition to the obvious speed boost, this lets you configure the caching and compression settings for the files.
Category: Javascript
Post by AskApache | Mar 01, 2008 | 16 comments
How To remove the /category/ from WordPress category urls.
James
We're using WP as a CMS with pages and posts. Done a bit of customization, so it looks sweet. Problem - i have some child categories that throw 404 when the category redirect is in place. How did you remove the category base from the url structure in wordpress?
Category: WordPress
Post by AskApache | Oct 17, 2008 | 11 comments
Top 3 ways to speed up websites that use Google Analytics. Host Script Locally, Fix Google-Analytics Cookie Domain, and Failsafe Loading for optimum tracking statistics.
Category: Google
Post by AskApache | Oct 20, 2008 | 5 comments
This past week I updated my sites apache.css file for a site-redesign. I wanted to make changes to the .css file that only I could see, so that my regular traffic and site-visitors would still see the old version. Here's the elegant solution I came up with using .htaccess and mod_rewrite that works so well I'm sharing it with all you wonderful and incredible people reading my blog :)
Category: Htaccess
Post by AskApache | Dec 19, 2008 | 7 comments
This is all new, experimental, and very very cool. It literally uses .htaccess techniques to create several virtual "locked gates" that require a specific key to unlock, in a specific order that cannot be bypassed. It uses whitelisting .htaccess tricks to specify exactly what is allowed, instead of trying to specify everything that isn't allowed. Also, by setting specific cookies/tokens after successfully passing through a gate, we can then require the exact cookie/token from the previous gate, which stops an attacker from skipping or bypassing gates.
Category: Htaccess
Post by AskApache | Mar 09, 2009 | 1 comment

3-Part article covering practical implementation of 3 advanced .htaccess features. Discover an easy way to boost your SEO the AskApache way (focus on visitors), a tip you might keep and use for life. Get some cool security tricks to use against spammers, crackers, and other nefarious sorts. Take your site's error handling to the next level, enhanced ErrorDocuments that go beyond 404's.
Category: Htaccess
Post by AskApache | Apr 14, 2009 | 6 comments
The goal is to add the HostGator server to be an exact mirror of the static.askapache.com domain, then to add that server as a 2nd A record to my DNS zone. That way half the visitors to the size will be taking up resources and bandwidth on the HostGator server instead of mine.
Round Robin A records in DNS are intended to evenly distribute queries between each host of the same name. Using some tricks straight out of a hackers toolbox we can verify if the distribution is taking place. (It is.)
Category: Linux
Post by AskApache | Apr 10, 2009 | 3 comments
Sometimes there is an urgent need for creating an exact duplicate or "mirror" of a web site on a separate server. This could be needed for creating Round Robin Setups, Load-Balancing, Failovers, or for just plain vanilla backups. In the past I have used a lot of different methods to copy data from one server to another, including creating an archive of the whole directory and then using scp to send the file over, creating an archive and then encrypting it and then sending that file over using ftp, curl, etc., and my persistence at learning new ways to do things has paid off because now I use rsync to keep an exact replica of the entire directory on an external server, without having to use all the CPU and resources of other mirroring methods.
Category: Security
Tags: rsync, ssh
Post by AskApache | Jun 27, 2009 | 16 comments
Here is the basic process that I use to speed up Windows. A lot of good tips and tricks I've picked up over the past 15+ years of crashing and burning Windows that can transform your PC to be much faster than its ever been. The process focuses on freeing up RAM/Memory, freeing up your CPU/Processor, and optimizing your Hard Drive for a permanent solution.
Make sure to check out the free software I recommend at the end, installing them after this optimization process will keep your machine fast for a long time.
Category: Windows
Post by AskApache | Oct 05, 2009 | 6 comments
If you ever wanted to know the best way to defragment and speed up your Windows-Based PC, I mean you really wanted to know, here is the 2nd part to my article on Windows Speed Optimizing that details the process I have found works really well. Definately not a quick process, and certainly not the best ever, just my best ever and one that you only have to do once to get the benefits.
This article has a lot of incredibly useful (and FREE) tools I recommend, which you can grab and use without reading the article..
Category: Windows
Post by AskApache | Oct 10, 2009 | 4 comments
To prepare for several upcoming articles on AskApache that are focused on optimizing Servers and Sites from a server admin level, here is an article to introduce the main tools that we will be using. These tools are used to optimize CPU time for each process using nice and renice, and other tools like ionice are used to optimize the Disk IO, or Disk speed / Disk traffic for each process. Then you can make sure your mysqld and httpd processes are always fast and prioritized.
Category: Optimization
Post by AskApache | Mar 18, 2010 | 7 comments
NOT a typo.. 30x is measurable, well-documented, and easily tested. This is what open-source is about. I haven’t had time to post much the past year, I'm always working! So I wanted to make up for that by publishing an article on a topic that would blow your mind and be something that you could actually start using and really get some benefit out of it. This is one of those articles that the majority of web hosting companies would love to see in paperback, so they could burn it.
Category: Optimization
Tags: tmpfs
Post by AskApache | Sep 16, 2009 | 1 comment
If you have files on your site that you don't want indexed by malicious search engines, grabbed and leeched by malicious spammers, or stolen and made available elsewhere, you can use mod_rewrite to drastically reduce or totally reduce that activity.
Category: Htaccess
Post by AskApache | Oct 18, 2009 | 4 comments
Advanced Web Development by AskApache is a Firefox Collection I created since I'm always trying new Addons out and using multiple computers and I wanted a quick and easy way to install my favorite's and keep a running list. Firebug, YSlow, LastPass, and Web Developer are the only ones I always use regularly.
I like the idea of the last.fm but it's not as powerful as the site, which is awesome. Lately listening to Kings of Leon Radio...
Category: Hacking
Post by AskApache | Mar 03, 2010 | 6 comments
The bottom line for this article is that I want to make WordPress as fast, secure, and easy to install, run, and manage because I am using it more and more for client production sites, I will work for days in order to solve an issue so that I never have to spend time on that issue again. Time is money in this industry and that is ultimately (time) what there is to gain by tweaking WordPress.
Note: I spent no time on readability, this is primarily a read the code and figure it out article.. This is for advanced users looking for a reference or discussion and for those of you looking to advance. Feedback would be great if you make it that far..
Category: WordPress
Post by AskApache | Nov 29, 2009 | 15 comments
There are so many WordPress plugins out there now that I wanted to post my favorite 3 plugins for speeding up a WP-Powered blog. These are the 3 plugins that I install for pretty much all of my WP-Powered sites, which I run about 300 now. They work together to provide a very optimized blog for speed.
DB-Cache Reloaded does something entirely different, it saves the mysql queries that are made to the WP-database, as well as the mysql results to static files, and then through php serves those cached-files instead of re-querying the mysql database. Most mysql databases are stored on separate servers, and although many are on the same local network there is a limit to how many queries, and how many connections can take place.
So DB-Cache Reloaded basically makes WP-Super Cache work alot faster when generating the cache files, and DB-Cache Reloaded helps in a number of areas un-related to WP-Super Cache, like in the admin panel. And DB-Cache without WP-Super-Cache is a joke because it still uses the application-level and php for everything. Gotta use both (or just WPSC).
Category: WordPress
Post by AskApache | Sep 07, 2010 | 2 comments
Oh ya lets get it on! short but sweet

Category: Hacking
Post by AskApache | Feb 23, 2010 | 8 comments
Ok I just came back up to write the intro.. I'm trying to keep it short to avoid getting bogged down by the coolness of each step. Here is what goes on. When I logon to my XP machine at work, I bring my usb key and plug it in first. On logging a window pops up first and it's a password prompt to mount my encrypted drive leonardo. It also checks a keyfile that is located on my usb key, but all I do now is type in my password. That causes my encrypted folder to be accessible to me like a normal drive, and it autoruns a startup batch file.
The batch file causes Portable versions of Firefox (all my bookmarks, my settings) to load, and launches Portable Mozilla Thunderbird (IMAP makes this work well), which is my favorite program (great GPG features and open-source!). Also Some Adobe CS4 software is loaded from the hard drive, like DreamWeaver. In the background, a service we created executes a PortaPuttY plink command to create forwarded tunnels from various remote servers and accounts, all using key-based encryption. These tunnels are automatically reconnected if they are disconnected, meaning you can use a socks 5 if you want or even better!
Part 1 of 5
Category: Hacking
Post by AskApache | May 25, 2010 | 11 comments
This amazing bash linux prompt does more than meets the eye. If you want to know how to become really good with technology, linux is the secret sauce behind the AskApache articles. Open Source is elixir of the web. Thanks to everyone who helped me for the past 20 years. I use linux/bsd because homey don't play, so this is geared to be as productive a prompt as I can make it.
Don't have much time.. or just don't care? Not a problem, here are the 3 lines to copy and paste - you can just paste them right in your shell to test it, or add to a startup script.
export AA_P="export PVE=\"\\033[m\\033[38;5;2m\"\$(( \`sed -n \"s/MemFree:[\\t ]\\+\\([0-9]\\+\\) kB/\\1/p\" /proc/meminfo\` / 1024 ))\"\\033[38;5;22m/\"\$((\`sed -n \"s/MemTotal:[\\t ]\\+\\([0-9]\\+\\) kB/\\1/p\" /proc/meminfo\`/ 1024 ))MB\"\\t\\033[m\\033[38;5;55m\$(< /proc/loadavg)\\033[m\";echo -en \"\""
export PROMPT_COMMAND="history -a;((\$SECONDS % 10==0 ))&&eval \"\$AA_P\";echo -en \"\$PVE\";"
export PS1="\\[\\e[m\\n\\e[1;30m\\][\$\$:\$PPID \\j:\\!\\[\\e[1;30m\\]]\\[\\e[0;36m\\] \\T \\d \\[\\e[1;30m\\][\\[\\e[1;34m\\]\\u@\\H\\[\\e[1;30m\\]:\\[\\e[0;37m\\]\${SSH_TTY} \\[\\e[0;32m\\]+\${SHLVL}\\[\\e[1;30m\\]] \\[\\e[1;37m\\]\\w\\[\\e[0;37m\\] \\n(\$SHLVL:\\!)\\\$ " && eval $AA_P Category: Linux
Post by AskApache | Apr 17, 2010 | 6 comments
#### No https except to wp-admin -
# If the request is empty ( implies fopen or normal file access by a php script )
RewriteCond %{THE_REQUEST} ^$ [OR]
# OR if the request if for wp-admin or wp-login.php
RewriteCond %{REQUEST_URI} ^/(wp-admin|wp-login\.php).*$ [NC,OR]
# OR if the Referer is https
RewriteCond %{HTTP_REFERER} ^https://www.askapache.com/.*$ [NC]
# THEN skip the following rule, basically all this does is force https or badhost to be redirected
# BUT because of the above 3 rewritecond's, this won't break poorly written admin scripts
RewriteRule .* - [S=1]
RewriteCond %{HTTPS} =on [OR]
RewriteCond %{HTTP_HOST} !^www\.askapache\.com$ [NC]
RewriteRule .* http://www.askapache.com%{REQUEST_URI} [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(wp-admin/.*|wp-login\.php.*)\ HTTP/ [NC]
RewriteCond %{HTTPS} !=on
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L] Category: Htaccess
Post by AskApache | Apr 25, 2010 | 9 comments
The following is a transcript of a chat I had with a company called tektonic, and at that time I was looking for a cheap linux host to use for some redundancy/failover operations. I generally contact a new hosting company like this every few months.. I like to have options available in case of some kind of failure or network attack, so it's always a good idea to have a few ace linux servers in your back pocket.
If you've read any other articles on AskApache, you can see a certain obsession towards optimization, speed, and security -- so that is the purpose of the following questions.
Category: Hosting
Post by AskApache | Sep 09, 2010 | 1 comment
Category: Htaccess
Post by AskApache | Sep 03, 2010 | 7 comments
If for some reason you need to use windows .bat batch file scripting to do some task, or you just want to learn the most universal batch programming language on Windows machines, you lucked out and found the AskApache example. My expertise is the shell, in this article the shell is Windows cmd.exe. It has some pretty advanced windows shell usage, including pipes and redirection, but it's the modular linux-like coding approach that earns this script it's "advanced" title.
:SETPROMPT
set PROMPT=$_[%USERNAME%@%USERDOMAIN%]$S[$P]$_$M$G && EXIT /B
My favorite tool (and I've tried sooo many) for editing most Windows files and especially .bat files is the free and open-source Notepad++. Set that up and you will have a color-syntax-highlighted editor for Batch Scripting that works very very well.
Category: Windows
Post by AskApache | Oct 16, 2010 | 5 comments
Here is even more information from the Ultimate Htaccess Part I. For now this is very rough and you will want to come back later to read it.
Category: Htaccess
Post by AskApache | Oct 22, 2010 | comment
So, here's what I hacked together last night, that is being used today. It's essentially 2 files.
- A php file that scrapes uses curl to scrape all the urls for the page (favicon, css, images, pdfs, etc..)
- A simple bash shell script acting as a cgi that creates a zip file of all the urls, and a self-extracting exe file for those without a winzip tool
Category: PHP
Post by AskApache | Oct 30, 2010 | 5 comments
This is the advanced example. It uses the jw flv player to create a flash proxy. This basically lets me control the youtube video as if it were a local .f4v file. With this method I can specify any options, autostart, volume, playlists, etc.. But it's rather complex so lets start with 3 other methods to embed YouTube video.
Category: Javascript
Post by AskApache | Dec 14, 2011 | comment
Kenny Powers Internet Commercial
Category: Web Design
Tags: Video
Post by AskApache | Nov 02, 2011 | comment
Youtube Music>
Category: Web Design
Page 1 of 1312345»10»»Last »