Posts Categorized: apache

htaccess symlink problem

I doubt this will be of any help to anyone else but for future reference.Problem:A content management system writes the URLs in <a> tags with a path e.g.: /sites/mysite/AboutUs but the customer wants the addressbar to show just: /mysite/AboutUs Solution:Add a symbolic link from the apache root to the site directory e.g. ln -s /var/www/sites/mysite… Read more »

htaccess examples

Temporarily take site down for maintenance Options +FollowSymlinks RewriteEngine on RewriteCond %{REMOTE_ADDR} !^111\.111\.222\.111 RewriteCond %{REQUEST_URI} !/index.html$ RewriteRule $ /index.html [R=302,L] or Options +FollowSymlinks RewriteEngine on RewriteCond %{REQUEST_URI} !^/oldsite/ RewriteCond %{REMOTE_HOST} !^123\.111\.123\.111 RewriteRule (.*) http://www.thedomain.com/oldsite/$1 [R=301,L] Redirecting to a New Domain Options +FollowSymLinks RewriteEngine on RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L] Force https use RewriteEngine On RewriteCond %{SERVER_PORT}… Read more »