Forum Moderators: phranque
RewriteEngine on
RewriteCond %{HTTP_HOST} example.cz$ [NC]
RewriteCond %{REQUEST_URI} !^/---example/.*$
RewriteRule ^(.*)$ /---example/$1
when I want to open a folder http://www.example.cz/test-folder
it opens me this one http://www.example.cz/---example/test-folder
whats wrong?
[edited by: jdMorgan at 10:39 pm (utc) on Oct. 10, 2007]
[edit reason] example domain [/edit]
I have two domains on one hosting so I would like to put the second one in a specific folder (dir) and when someone type this domain name to
get in to that folder but not to make a change in url.
So when you want to open http://www.example.com/ it opens precisely http://www.example.com/ (and to not add "dir" nothing after) and when I want to open http://www.example.com/test-folder/ to open as it is and to not add "dir" as I show you In my previous post.
Thank you
I think you're looking for a 'system' here, because one rule is not really enough.
RewriteEngine on
#
# Internally rewrite requests for second-domain.com to "/-second-domain" subdirectory
RewriteCond %{HTTP_HOST} second-domain\.com [NC]
RewriteCond %{REQUEST_URI} !^/-second-domain/
RewriteRule (.*) /-second-domain/$1 [L]
#
# Externally redirect client requests for /-second-domain/<page> back to second-domain.com/<page>
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /-second-domain/
RewriteRule ^-second-domain/(.*)$ http://second-domain.com/$1 [R=301,L]
RewriteCond %{REQUEST_URI} !^/test-dir/
RewriteCond %{REQUEST_URI} !^/common-images/
RewriteCond %{REQUEST_URI} !^/common-scripts/
...