- Code: Select all
RewriteEngine On
RewriteCond %{HTTP_HOST} !^(www\.)?DOMAIN$ [NC]
RewriteCond %{HTTP_HOST} ^([^.]+)\.DOMAIN$ [NC]
RewriteCond %1---%{REQUEST_URI} !^(.+)---/\1(/.*)?$
RewriteRule .* /%1%{REQUEST_URI} [QSA,L]
Currently, i had to put the following code in the file .htaccess in every directory in order to enable search engine friendly url for my subdomain.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /goody/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /goody/index.php [L]
</IfModule>
is it possible to setup a single mod_rewrite code at root level to handle all these? what are code to add on to my above .htaccess file at root lvl?