Question

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.

Was it helpful?

Solution

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]
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top