Welcome To Snipplr
Everyone's Recent Apache Snippets
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
Great little bit of code for if you are rewriting URLs but then want the old GET URLs to rewrite to their rewritten URLs (phew). Good for telling Google where the new pages are with a 301 rather than getting both indexed.
In this example, i had a...
0
1062
posted 16 years ago by roflman79
This line can be added to 'backend', 'frontend', 'listen' directives in the HAProxy config.
It will redirect all requests for /books/mysql to /books.php?title=mysql
0
2014
posted 16 years ago by alexwilliams
In this example:
*rewrite urls from domain.com to www.domain.com*
This is somewhat documented elsewhere, but not very well, so here's an example on how to perform simple URL rewriting with HAProxy (instead of using mod_rewrite with apache)....
0
1352
posted 16 years ago by alexwilliams
In addition to the recommendations on the Wordpress Website.
Limit the amount of PHP files that a writable by Apache. The directory's and files that need to be writable, do not always need to be executed by PHP directly.
This makes it a bit har...
1
1135
posted 16 years ago by occam
Needed to retire a staging domain, so I'm redirected all traffic to the equivalent page in the root directory in the .htaccess file
1
1253
posted 16 years ago by canarymason
Combine this with the my compression script and things load real fast. I think I pulled some of this code of a site on google... can't claim complete credit.
0
1377
posted 16 years ago by iloveitaly
Due to widespread internet blocking in Iran following the June 2009 election, a network of proxy servers was set up to assist in the free flow of information. The IP range, to the best of my knowledge, should cover the addresses used in Iran, with bl...
0
1322
posted 16 years ago by kwilson
long htaccess expired header for all files except for server side scripts
2
1674
posted 16 years ago by dennyhalim
Just insert it into your .htaccess file to redirect all your 404 error pages to any address
2
1267
posted 16 years ago by caruso_g
In MODx, insert below:
# The Friendly URLs part
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
2
1218
posted 16 years ago by hotdiggity
My [original post](http://drupal.org/node/84895) languished for years before someone pointed out a possible solution [here](http://drupal.org/node/53705).
The following user-submitted code may be useful in redirecting URLs for the /files directory...
0
1188
posted 16 years ago by zachharkey
This is a little trick I've used a few times to emulate Folders on a site and drop the extensions. In this example I'm using a PHP site but could easily be ported for other file types. One caveat to look out for is files will not always want to be ca...
1
972
posted 16 years ago by jackkeller
SESSIONNAME = Name of your session cookie;
example.com = Domainname of your site
1
1044
posted 16 years ago by HeWo42
This is a replacement for the default PHP settings in Drupal's .htaccess file. Increasing the memory_limit, max_post_size etc. prevents a lot of errors, especially when using image modules.
0
1216
posted 16 years ago by zachharkey