I would do it like this, give it a try.
RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.domain.com$
RewriteCond %{REQUEST_URI} !folder/
RewriteRule (.*) /folder/$1 [L]
質問
When the user navigates to http://domain.com, I'd like to specify which subfolder's index.php they're pulling up. This will change every few months, as it's a publication (so /issue-1/, /issue-2/, and so forth).
Here's what I have in my .htaccess file so far:
DirectoryIndex /issue-2/index.php
It don't work.
解決
I would do it like this, give it a try.
RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.domain.com$
RewriteCond %{REQUEST_URI} !folder/
RewriteRule (.*) /folder/$1 [L]