Skip to content

Instantly share code, notes, and snippets.

@seaders
seaders / gist:5668016
Last active December 17, 2015 20:29
Way to redirect a subdomain other than 'www' to a subdirectory with Apache. Apache mods enabled are 'headers', 'proxy', 'proxy_http' and 'rewrite'.
<VirtualHost *:80>
ServerName www.sixminute.com
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.sixminute\.com [NC]
RewriteCond %{HTTP_HOST} ^(.*?)\.?sixminute\.com$
RewriteRule ^/(.*) http://www.sixminute.com/%1/$1 [P]
ProxyPassReverse / http://www.sixminute.com/%1/
@seaders
seaders / PersistentWebdriver.py
Created May 26, 2013 20:05 — forked from dnedbaylo/PersistentWebdriver.py
Valid for newest selenium and pep8 compliant.
from selenium import webdriver
from selenium.webdriver.remote.remote_connection import RemoteConnection
from selenium.webdriver.remote.errorhandler import ErrorHandler
class PersistentWebdriver (webdriver.Remote):
def __init__(self, command_executor='http://127.0.0.1:4444/wd/hub',
desired_capabilities=None, browser_profile=None, proxy=None,