I'm trying to do so if the user going to this url:
http://www.abc.com/
it will redirect him to
http://www.abc.com/minisite/
or, if he's going to tihs url:
http://www.abc.com/dir/something.php
it will redirect him to:
http://www.abc.com/minisite/dir/something.php
I'm trying to do this in Mod_Rewrite... Here is what I've wrriten so far:
RewriteRule ^$ /minisite/$1 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
Rewrit开发者_StackOverfloweRule ^(.*)$ /minisite/$1 [L,QSA]
It's working, but the problem is that if im going to a non exist page, it do 500 instead of 404..
Any ideas on how to fix that and/or improve my rules?
Thanks and sorry for English (it'd be great if you'll edit this question so the grammer will be correct and more understandable, thanks).
what you need is as simple as
RewriteCond %{REQUEST_URI} !minisite
RewriteRule (.*) minisite/$1 [L]
This will map anything coming in (except well-formed minisite URLs) to the minisite directory.
精彩评论