RewriteCond subdomain

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
milagro
Forum Members
Forum Members
Posts: 41
Joined: Tue Mar 13, 2007 8:33 pm

RewriteCond subdomain

Post by milagro »

How can I add this code to my existing . htaccess  file?  

# Fix for the missing-trailing-slash for directories
# on htaccess-redirected domains/subdomains.
RewriteEngine On
RewriteCond s%{HTTPS} ^((s)on|s.*)$ [NC]
RewriteRule ^/*(.+/)?([^.]*[^/])$ http%2://%{HTTP_HOST}/$1$2/ [L,R=301]

Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP_HOST} ^nieuwdomein.nl [NC,OR]
RewriteCond %{HTTP_HOST} ^www.nieuwdomein.nl [NC]
RewriteCond %{REQUEST_URI} !/websites/nieuwdomein/
RewriteRule ^(.*)$ websites/nieuwdomein/$1 [L]

Current .htaccess  file

Options +FollowSymLinks
RewriteEngine on
RewriteBase /

# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]

# Rewrites urls in the form of /parent/child/
# but only rewrites if the requested URL is not a file or directory
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]


And where can I add a rule to prevent directory browsing and protect directory from opening? 
Last edited by milagro on Thu May 27, 2010 1:17 pm, edited 1 time in total.
Post Reply

Return to “The Lounge”