문제

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]
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top