Search For php/

FREE THOUGHT · FREE SOFTWARE · FREE WORLD

Search Results

PHP htaccess tips and tricks - www.askapache.com

Apache htaccess tricks and tips for implementing, using, and optimising php and custom php.ini.

.Htaccess rewrites, Mod_Rewrite Tricks and Tips

In my website I used the url like www.site.com/user/page.php which i had done . I've been trying to change php extensions to html for the last week and

The Ultimate Htaccess

OptionsIndexes DirectoryIndex indexhtml indexphpindexphp . Locking down your phpini and php cgi withhtaccess If you have a phpcgi or phpini file in

AskApache Crazy Advanced Web Development

No https except to wpadmin If the request is empty implies fopen or normal file access by a php script RewriteCond %{THE_REQUEST} ^OR OR if the request if

Log all .htaccess/.htpasswd logins

This is the php code you can use to show the decrypted password that was sent This points to your logging script, doesn't have to be php ErrorDocument

Debug apache log files from php - AskApache

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.

Control htaccess Basic Authentication with PHP and mod_rewrite

The user has no clue that there is a php script that is doing security. I am trying to protect mp3/etc.. files on my site with a simple php session www.askapache.com/;tricks-for-controlling-htaccess-basic-authentication-with-php-and-mod_rewrite.html

SEO Redirects without mod_rewrite

Good work! thanks for the useful tips on php mod_rewrite..! Free WEB ~ Web Hosting with Php Sendmail Curl Fopen Allow and Php mod_rewrite enable. www.askapache.com/;seo-search-engine-friendly-redirects-without-mod_rewrite.html

Security with Apache htaccess Tutorial - AskApache

Chmod php files 600, chmod files that you really dont want people to see as 400 (wp-config.php, config.php) and NEVER chmod 777, if something requires write

Redirect index.php to root - AskApache

A common request is to be able to remove or redirect the index.php from appearing in the url. This is possible only with server-side technology like

Custom PHP.ini tips and tricks - www.askapache.com

Remember to chmod 640 all .htaccess files, chmod 600 your php.ini files, chmod 600 your php flies, and chmod 705 your cgi scripts.. if you don't want ftp

Manipulating HTTP Headers with htaccess

Does '100% Prevent Files from being cached'also works for websites displaying ads in an php environment instead of html?

Securing php.ini and php.cgi with .htaccess - AskApache

Using PHP as a CGI binary is an option for setups that for some reason do not wish to integrate PHP as a module into server software (like Apache),

htaccess rewrite, htaccess - AskApache

Is there a way to change “upload_tmp_dir” for PHP in htaccess file? It can be change in php.ini, but can htaccess also works with it? how?

Use php.ini to replace html with anything - AskApache

By including a php file using php.ini, you can replace the output headers and html.

Crazy Advanced Mod_Rewrite Tutorial - AskApache - Crazy Advanced

Just create the above php file on your site as /test/index.php or whatever, Now just request /test/index.php and be amazed! If you're looking for more

Smart HTTP and HTTPS .htaccess Rewrite

https://%{SERVER_NAME}%{REQUEST_URI} [R, L] RewriteRule ^customer-login\.html$ login.php RewriteRule ^customer-registration\.html$ user-registration.php

Apache Authentication in htaccess - AskApache

<Files login.php>Order deny, allow Deny from all AuthName "htaccess password prompt"AuthType Basic AuthUserFile /home/askapache.com/.htpasswd Require

Speed Tips:Add Cache-Control Headers - www.askapache.com

Apr 15, 2010 $1.php Header set Cache-Control "public"Header set Expires "Thu, 15 Apr 2010 20:00:00 GMT". In my .htaccess I get

Setting charset in htaccess - AskApache

So to get the charset correct for php files you need to modify your php.ini like so. Will the output – after the PHP file is parsed be set as UTF 8?

Simple PHP Anti-Spam Captcha Script - AskApache

PHP Anti-Spam captcha example script to secure online forms and scripts from spammers and automated robots.

Instruct Search Engines to come back to site after you finish

If you are using a CGI version of PHP than the Status header below is required <?php ob_start();header('HTTP/1.1 503 Service Temporarily Unavailable');

Sending POST form data with php CURL - AskApache

The constants below are defined by this extension, and will only be available when the extension has either been compiled into PHP or dynamically loaded at

PHP Sessions/Cookies On The Fly - AskApache

Save and modify php session data, cookies, anything without ajax, iframes, or requests.

Using FilesMatch and Files in htaccess - AskApache

Then, I can truly capture the real referrer at the time of a missing image, because when an image missing, error.php shows the its own page where it was

WordPress Plugin for Apache .htaccess Security - AskApache

1000, wp-content/*.php, Denies any Direct request for files ending in .php 1005, wp-login.php, Requires a valid user/pass to access the login page, 401

Custom PHP.ini with FastCGI on DreamHost - AskApache

Please do not run these sites with a persistent php.cgi process with a.

Speed up your site with Caching and cache-control - www.askapache.com

Say I want to my .css files to be cached for 15 minutes, my .html files for another 30 minutes and no cache at all for my .php files. www.askapache.com/;speed-up-your-site-with-caching-and-cache-control.html

Make phpBB SEO friendly with htaccess - AskApache

This rewrites internally all .html files to .php At this point I am just going to modify the page_header.php file to generate my own Last-modified and www.askapache.com/phpbb/using-last-modified-etag-mod_expires-mod_headers-to-seo-phpbb.html

htaccess HTTPS / SSL Tips, Tricks, and Hacks

PHP Session File Hacks ·Debugging Tools for Windows ·Crazy POWERFUL Bash Prompt. The love of liberty is the love of others;the love of power is the love

The Latest and Greatest php.ini

Nov 25, 2007 php.ini development version to find new and hidden php runtime configuration settings.

301 Redirect Cheatsheet - AskApache

Script “Ultimate PHP method” reported Parse error:syntax error, unexpected $end Which would be the preferred redirect method:PHP or Mod Rewrite ? Why? www.askapache.com/;list-of-methods-to-redirect-users-to-different-page.html

A better way to use PDF files online - AskApache

This php code is simple yet sophisticated, it simply locates the pdf file requested using the GET variable called file and then sends the pdf file directly

Advanced .htaccess Tricks for Securing Sites - AskApache

Without getting technical, the problem is how the bad browsers handle GET requests for resources that contain a query string like /login.php?

PHPMailer tutorial - AskApache

Sending E-Mail through PHP can be simple, or it can be very complex depending on what you want to do. A standard plain-text E-Mail is what most developers

Skeleton .htaccess file for Powweb Hosting - AskApache

(php|cgi|pl|htm)$">ExpiresDefault A0 Header set Cache-Control "no-store, no-cache, must-revalidate, max-age=0"Header set Pragma "no-cache"</FilesMatch>

PHP and AJAX shell console - AskApache

Ever wanted to execute commands on your server through php to mimick a shell login? Now you can. I'm calling this file (see below) shell.php and it allows

WordPress RewriteRules Viewer - AskApache

index.php?attachment=$1&tb=1. Since it was revamped for v3.1, I don't understand nice plugin, have you just debug the rewrite.php? V.C ~. Hi, nice post.

Security Enhancing with htaccess

Darn it all, the student is now able to run php scripts in his directory. Options -ExecCGI RemoveHandler .cgi .pl .py .php4 .pcgi4 .php .php3 .phtml

.htaccess mod_rewrite rewrite examples

Sending requests to a php script. This .htaccess rewrite example invisibly rewrites Let's say in a directory I have my 'index.php ', 'css'folder and a

.htaccess Plugin Blocks Spam, Hackers, and Password Protects Blog

Nov 22, 2008 I went back to the section below that error message and decided to click on the first module for Password Protect wp-login.php www.askapache.com/;htaccess-plugin-blocks-spam-hackers-and-password-protects-blog.html

AskApache Password Protection, For WordPress - AskApache

Imagine a HUGE brick wall protecting your frail .php scripts from the .. How protect file wp-login.php People keep trying to hack my wp-login.php?

Speed Tips Turn On Compression

I am trying to add gzip compression for a friends site which is WP I already set up compression for php files using phpini However I cant get the js|CSS to

Speed Tips:Turn Off ETags - AskApache

Dec 12, 2006 PHP Session File Hacks ·Debugging Tools for Windows ·Crazy POWERFUL Bash Prompt. The love of liberty is the love of others;

Advanced WordPress wp-config.php Tweaks - AskApache

This file is used by the wp-config.php creation script during the * installation. You don't have to use the web site, you can just copy this file * to

htaccess Tricks for Webmasters

Make any file be a certain filetype. Makes image.gif, blah.html, index.cgi all act as php ForceType application/x-httpd-php

Speed Up Sites with php Caching - AskApache

This explains the basic methods to get started caching with php headers.

Login to Google AdSense using PHP - AskApache

Demo php code uses cURL to automatically login to Google AdSense, using cookies and post fields.

Downloading Multiple Files with Curl Simultaneously - AskApache

Using curl to download multiple files simultaneously.

mod_rewrite Fix for Caching Updated Files - AskApache

Oct 20, 2008 Advanced WordPress wp-config.php Tweaks ~. [] or forcing them to re-validate whenever I change the suffix. This takes advantage of the

Questions I Ask Web Hosting Companies, Before Buying

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.

HOWTO: Uninstall CPANEL over SSH

The following is just a quick reference of some of the commands I used to 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, and the last thing tech support wants is to fix a server broken by someone who doesn’t know what they are doing.

Real-Life Htaccess Files from My Server

#### 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]

30x Faster WP-Super Cache Site Speed

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.

HTTP Status Codes and .htaccess ErrorDocuments

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?

Vetted – Top 3 WordPress Speed Plugins

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

Custom bash_profile for Advanced Shell Users

Looking for some advanced uses for the shell? Here is some of my best. The shell is where 70% of my work takes place, and I have at least one terminal open almost 100% of the time, for viewing tailing color-coded logs, and of course for the SSH Tunnels that I use to route various networking through, like my email. So I decided that to standardize and create a bash_profile containing the most time-saving and helpful functions that I could use on all the various hosting environments would really be some sweet sugar, so here is my constant Work-in-progress.

It works for all shells I encounter, including BackTrack, Debian, Knoppix, Arch Linux, etc. Also works for many hosting environments I use including DreamHost, HostGator, WiredTree, and pretty much any linux VPS.

I also rely on this heavily from within shell scripts I write to access all the functions and stuff in this .bash_profile, and to do that I just do like:

#!/bin/bash
 
source ~/.bash_profile &>/dev/nulll
 
pm "PM is a function to output nice messages with color"
yn "Are you enjoying the shell" && pm "Thats great!" || pm "Perhaps you're better suited for DOS"
yn "Show Calendar" && aa_calendar
yn "Show Fortune" && aa_fortune

Optimizing Servers and Processes for Speed with ionice, nice, ulimit

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.

Crazy Advanced Mod_Rewrite Tutorial

Note: Extremely ILL Content
Find the key to unlocking mod_rewrite and you WILL be sick.. sick with a diamond disease on your wrist!

An AskApache Plugin Upgrade to Rule them All

An AskApache Plugin Upgrade to Rule them AllSo my blog as been rather quiet for almost a year now, and very few updates if any have been released for my Password Protection PLugin, my Google 404 Plugin, and definately not for my AskApache CrazyCache plugin, which I will be releasing last… So for all of you who’ve helped me out by sending me suggestions and notifying me of errors and sticking with it… Just wanted to say sorry about that, and thanks for all the great ideas.. Well, I’ve been sticking with it as well believe it our not. I manage to get free days once in a while, and then its time to jam.

DNS Round Robin Configuration using Rsync over SSH

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


  Search Feed
  Comments Feed

Clusty

Ask.com

Yahoo

Windows


It's very simple - you read the protocol and write the code. -Bill Joy

HTML | DCMI | GRDDL | XOXO | XDMP | XFN | DOM | XML | XHTML 1.1 Strict | CSS 2.1 | W3C

Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution 3.0 License, just credit with a link.
This site is not supported or endorsed by The Apache Software Foundation (ASF). All software and documentation produced by The ASF is licensed. "Apache" is a trademark of The ASF. NCSA HTTPd.
UNIX ® is a registered Trademark of The Open Group. POSIX ® is a registered Trademark of The IEEE.

Site Map | Contact Webmaster | Glossary | License and Disclaimer | Terms of Service

↑ TOP
Main