background preloader

Server

Facebook Twitter

.htaccess tricks and tips.. part two: url rewriting with mod rewrite. Corz.org uses cookies to remember that you've seen this notice explaining that corz.org uses cookies, okay! <ifModule> more clever stuff here </ifModule> redirecting and rewriting "The great thing about mod_rewrite is it gives you all the configurability and flexibility of Sendmail. The downside to mod_rewrite is that it gives you all the configurability and flexibility of Sendmail. " - Brian Behlendorf, Apache Group One of the more powerful tricks of the .htaccess hacker is the ability to rewrite URLs. Make no mistake, mod_rewrite is complex.

The way that rules can work one minute and then seem not to the next, how browser and other in-between network caches interact with rules and testing rules is often baffling, maddening. After all this, it does work, and while I'm not planning on taking that week-end crash-course any time soon, I have picked up a few wee tricks myself, messing around with web servers and web sites, this place..

Very little here is my own invention. Beginning rewriting.. Htaccess rewrite, htaccess. An attempt to create a default skeleton .htaccess file with the very best apache htaccess examples... Updated semi-frequently based on detailed info from the Apache htaccess tutorial. NOTE:Check out and use the Google 404 Error Page. Sample Htaccess File ^ If you see any room for improvement, or if you can add something than go ahead and comment and I will definately give it a look for possible inclusion. ### MAIN SETTINGS AND OPTIONS # Options: ALL,FollowSymLinks,Includes,IncludesNOEXEC,SymLinksIfOwnerMatch ### MAIN DEFAULTS Options +ExecCGI -Indexes DirectoryIndex index.html index.htm index.php DefaultLanguage en-US AddDefaultCharset UTF-8 ServerSignature Off ### ENVIRONMENT VARIABLES SetEnv PHPRC /webroot/includes SetEnv TZ America/Indianapolis SetEnv SERVER_ADMIN webmaster@domain.tld ### MIME TYPES AddType video/x-flv .flv AddType application/x-shockwave-flash .swf AddType image/x-icon .ico 2xx ErrorDocuments ^ 4xx ErrorDocuments ^ 5xx ErrorDocuments ^ Add Languages ^ Tags ^ April 3rd, 2007.

How to make a subfolder the main folder for your BlueHost main domain. If you are using BlueHost for your web hosting you already know that the domain you use to signup for your account is your Primary domain. By default, the Primary domain is set to reside in the public_html I recently moved my hosting to BlueHost and have been very happy with both the tech support and their services. BlueHost allows you to host multiple domains within the one account.

The main or primary domain on the hosting account uses the public_html folder for all of its web site files. I use Expression Web as my web editor and publish using the ftp facility from within the program in most cases. There had to be a way to remedy this so I went searching the BlueHost support forums and found it. Creating the .htaccess file This is the information provided by BlueHost: # Do not change this line. RewriteEngine on # Change your-domain.com to be your main domain. RewriteCond %{HTTP_HOST} ^(www.)? # Change 'subfolder' to be the folder you will use for your main domain. # Don't change this line.

Rewrite

Htaccess Tools. Server Info CGI Program. FastCGI -- The Forgotten Treasure. FastCGI — The Forgotten Treasure Abstract Meeting the demands on modern web sites is more difficult than ever: People are no longer interested in “home pages”; they want web-based applications that provide useful functionality. Thus, the complexity of the average web site has increased dramatically for the programmer. Furthermore, the performance requirements have gone up: The faster the Internet gets, the less are people willing to wait. At the same time, though, the number of users has increased by an order of magnitude! Facing this situation, web developers ought to ask themselves: “Are the tools we use to write web-based applications still adequate?”

This paper shows developers how high-performance web applications can be implemented quite easily using the FastCGI interface and C++. All source codes shown in this paper are available on the word-wide web at [Simons2002]. More sophisticated developers, however, created entire applications using the CGI interface. Figure 1. Apache on Windows binaries and modules download. Apache 2.4 VC14 Windows Binaries and Modules Apache Lounge has provided up-to-date Windows binaries and popular third-party modules for more than 10 years. We have hundreds of thousands of satisfied users: small and big companies as well as personal users. Always build with up to date dependencies and latest compilers, and tested thorough. The binaries are referenced by the ASF, Microsoft, PHP etc. and more and more software is packaged with our binaries and modules. The binaries below, are build with the sources from ASF at httpd.apache.org, contains the latest patches and latest dependencies like zlib, openssl etc. which makes the downloads here mostly more actual then downloads from other places.

Build with the latest Windows® Visual Studio C++ 2015 aka VC14. The binaries below do not run on XP and 2003. After you have downloaded and before you attempt to install, you should make sure that it is intact and has not been tampered with. Apache 2.4 binaries VC14 Info & Changelog.

Mail

Directives. PortaPutty Auto-Reconnecting SSH Tunnels on an Encrypted TrueCrypt Portable USB Key w GPG. Web Server Management: Running Apache 2.2 under Linux. Get to know Apache Click. The examples shown in this article require you to have Eclipse installed, as well as a Web application server. The examples specifically use Tomcat 6.0, but other Web application servers such as WebSphere® Application Server Community Edition, Jetty, or older versions of Tomcat should also work.

If you don't have a Web application server installed, see Resources to download and install Apache Tomcat 6.0 or WebSphere Application Server Community Edition. Apache Click overview Apache Click is a Web application framework that lets you quickly build Java Web applications. The purpose of Apache Click is to provide a method of building Web applications without using JSPs or MVC frameworks, which can be heavy-handed for some Web applications. Apache Click is licensed with the Apache License (see Resources). Instead of a heavy framework, Apache Click uses HTML templates and plain old Java objects (POJOs). The POJOs inherit from base classes provided by the Apache Click distribution. Back to top <? Stupid htaccess Tricks. Welcome to Perishable Press! This article, Stupid htaccess Tricks, covers just about every htaccess “trick” in the book, and is easily the site’s most popular offering. In addition to this htaccess article, you may also want to explore the rapidly expanding htaccess tag archive.

Along with all things htaccess, Perishable Press also focuses on (X)HTML, CSS, PHP, JavaScript, security, and just about every other aspect of web design, blogging, and online success. If these topics are of interest to you, I encourage you to subscribe to Perishable Press for a periodic dose of online enlightenment ;) General Information [ ^ ] .htaccess Definition 1 ^ Apache server software provides distributed (i.e., directory-level) configuration via Hypertext Access files.

Commenting .htaccess Code ^ Comments are essential to maintaining control over any involved portion of code. Important Notes for .htaccess Noobs ^ As a configuration file, .htaccess is very powerful. Performance Issues ^ [S=x] [E=variable:value] Appendix A Server Performance Analyzing and Scaling. Published: February 25, 2008 The following information identifies important monitoring counters used for capacity planning and performance monitoring of a system.

Over-committing CPU resources can adversely affect all the workloads on the same server, causing significant performance issues for a larger number of users. Because CPU resource use patterns can vary significantly, no single metric or unit can quantify total resource requirements. At the highest level, measurements can be taken to see how the processor is utilized within the entire system and whether threads are being delayed. Table 4. Processor\% Processor Time As a general rule, processors that are running for sustained periods at greater than 90 percent busy are running at their CPU capacity limits. For response-oriented workloads, sustained periods of utilization above 80 percent should be investigated closely as this can affect the responsiveness of the system. System\Processor Queue Length Table 5. Memory\Pages/sec. How to Install Apache 2.2 on Windows Vista.

Avoid Setup Errors, Port 80 Binding Errors, etc by Christopher Heng, thesitewizard.com Although I have written a number of articles on installing Apache 2.2, 2.0 and 1.3 on Windows in the past, they were designed for installation on Windows XP and earlier. With Windows Vista now being used by more developers, people are finding that getting Apache to install successfully, let alone work, on Vista is not trivial. This tutorial deals with how you can set up Apache 2.2 on Windows Vista so that it will not only work properly, but is also easy to configure and to update. Preliminary Notes This guide only applies to the Apache 2.2.x series, where "x" stands for some number. Make Sure Nothing is Listening on Port 80 The first thing you must do before you try to install Apache 2.2 on Vista is to make sure that there are no other programs listening on port 80 of your computer.

How to Find Out If What Service or Program is Listening on Port 80 Now hit Ctrl+Shift+ESC on your keyboard. Stupid htaccess Tricks. Welcome to Perishable Press! This article, Stupid htaccess Tricks, covers just about every htaccess “trick” in the book, and is easily the site’s most popular offering. In addition to this htaccess article, you may also want to explore the rapidly expanding htaccess tag archive. Along with all things htaccess, Perishable Press also focuses on (X)HTML, CSS, PHP, JavaScript, security, and just about every other aspect of web design, blogging, and online success. If these topics are of interest to you, I encourage you to subscribe to Perishable Press for a periodic dose of online enlightenment ;) General Information [ ^ ] .htaccess Definition 1 ^ Apache server software provides distributed (i.e., directory-level) configuration via Hypertext Access files.

Commenting .htaccess Code ^ Comments are essential to maintaining control over any involved portion of code. Important Notes for .htaccess Noobs ^ As a configuration file, .htaccess is very powerful. Performance Issues ^ [S=x] [E=variable:value] Install PHP 5 Apache MySQL on Windows : WampServer. Apache rewrite based on subdomain. How can I use &quot;mod rewrite&quot; to redirect a folder path to a subdomain, but without a browser redirect. How to redirect all pages to the homepage - Search Marketing Arena. Htaccess non-www redirect and subdir. No, I specified Apache 1.x because Apache 1.x uses the reverse order of the LoadModule list to determine execution order, and this "reverse order" thing trips up many server admins. For example, when adding PHP, many times they just figure, "Well, I'll add it at the end -- That should be safe.

" Then they wonder why mod_auth (authorization/authentication), mod_rewrite, and all the others don't seem to work for PHP files... It's because PHP executes first, and goes straight to the content-delivery API phase, by-passing execution of all the other modules. On Apache 2.x, module execution order is controlled by an internal priority scheme, and can't be changed unless you modify the Apache source and re-compile it.

To be very clear about all of the above: Each Apache module parses your .htaccess file(s) in turn, looking for directives that it understands and handles. Ultimate htaccess Examples. Here's my list of the ultimate htaccess code snippets and examples that I use all the time. I tried to keep them extremely minimalistic. Don't miss checking out my example htaccess file, its very comprehensive Hey jason I'm glad someone finally noticed the "development" htaccess at the bottom of my file! Thats honestly the piece of code I am most glad to have. Heres the actual code that I use when I'm developing sites for clients This lets google crawl the page, lets me access the whole site (24.205.23.222) without a password, and lets my client access the page WITH a password.

. # ELITE HTACCESS FOR WEBDEVELOPERS##############################################AuthName "SiteName Administration"AuthUserFile /home/sitename.com/.htpasswdAuthType basicRequire valid-userOrder deny,allowDeny from allAllow from 24\.205\.23\.222Allow from w3.org htmlhelp.comAllow from googlebot.comSatisfy AnyEach code snippet has been copied from htaccesselite. Apache Documentation: 1.3 2.0 2.2 Current Require the www.