- Sep 10, 2010
- 11,808
- 26,660
Oh shit..check it out you will see it is showing all my site folder, but if i click on public and forum they will open.
Ok let's add another redirect rule for empty query string.. Try this:
Code:
Options +FollowSymLinks
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
#https redirect
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
#no QSR redirect
RewriteRule ^$ public/index.php [L]
#other redirects
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
By the way..
Note 1: you could avoid all these troubles by setting your vhost up correctly. To do that, you just needed to have the domain pointed to the public folder instead of the project folder (which is supposed to be private anyway). It's called public for a reason. As for the forum, you could have it inside the public folder. Your htaccess in this case would be much more simpler than this.
Note 2: Be careful about SEO aspect of the redirect. Do not hold me responsible for that please.