- EDIT - Found http://forum.modrewrite.com/viewtopic.php?t=2670 which worked, sorry I am so green, and a bit too tired last night.
I want to run my cms out of a subdirectory, so I want to go to index.php in www.domain.com/subdir/ when entering www.domain.com in the address bar.
I used code from viewtopic.php?t=4282, so my htaccess looks like this:
- Code: Select all
Options +FollowSymLinks
RewriteEngine On
....
# Fix missing trailing slashes.
RewriteCond /subdir%{HTTP_HOST} ^(/subdir)(www\.)?maindomain\.net$ [NC]
RewriteCond %{DOCUMENT_ROOT}%1%{REQUEST_URI}/ -d
RewriteRule [^/]$ %{REQUEST_URI}/ [R=301,L]
# Rewrite:
# maindomain.net/* --> /maindomain/*
RewriteCond /subdir%{HTTP_HOST} ^(/subdir)(www\.)?maindomain\.net$ [NC]
RewriteRule .* %1%{REQUEST_URI} [R=301,L]
When maindomain.net is typed in address bar, maindomain.net/subdir/index.php comes up correctly, which is good, but I don't want the subdirectory to show. What code can I put in htaccess to bring up this page without having the subdir show?
TIA,