Thanks shyam, but working partially.
I already have an htaccess in the root with
Rule 1
Code:
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
and
Quote:
|
Originally Posted by shyam
RewriteCond %{HTTP_HOST} ^www.example.com/.*
RewriteRule ^/(.*)$ /22-Jan-2008/$1 [L]
|
doesn't work as such. So I used just
Rule 2
Code:
RewriteRule ^(.*)$ 22-Jan-2008/$1 [L]
and now it looks for contents in the subfolder rather than root as desired.
---------------
My
subfolder contains another htaccess to style the url like
Rule 3
Code:
RewriteRule ^([^/\.]+)$ index.php?page=$1 [L]
Now the problems are
1)Users can access the site through www.example.com/22-Jan-2007. Can I prevent this?
2)www is not get appended when someone types http://example.com/22-Jan-2007. Can I modify my above
Rule 1 to inherit the effect to here also?
3)My index page looks for the url to decide which content to be displayed using
PHP Code:
if(!$page=strtolower($_GET['page']))
$page='home';
;
(which use
Rule 3)
where I have a
switch($page) and in the default case I'd like to display a custom 404 message.
But this doesn't work if someone type www.example.com/22-Jan-2007
/blah. Any solutions?
Sorry If my explanation is too complex. Hope everything is due to some shortage in the rules. I've gone through many articles but didn't get enough grip. Please help.