Welcome Guest, Not a member yet? Register   Sign In
Redirect "/" to "/home"?

That didn't work unfortunately. Maybe I should reword it.

I need http://domain/app to redirect to http://domain/app/home but I don't know what the "app" is going to be named so is there a way to set the mod_rewrite to be relative to the current directory?

Ok, I think a better way to put it is, how can I have the front controller/index.php hard redirect to the default controller?

It's still not making much sense, the .htaccess file i posted above works for a redirect, I tested it on my own server. So it shouldn't be hard to modify that to what you want.

Using mod_redirect seems like the dirty solution to me, not the cleaner one. It sounds like you're making something that should be fairly portable since you're not sure if it will be in a sub directory or not. .htaccess files are significantly less portable than just having a controller method responsible for the redirect.

If I were you, I would set my default controller as one similar to the one posted above, except instead of checking for anything, just always redirect to 'home'. Then it doesn't matter if it's in a subdirectory or hosted on a windows box under IIS, it'll still redirect correctly as long as your config is correct.

Although, this brings up another point that I didn't see clarified. If it is in a subdirectory and someone browses to the root of the site, should it redirect to home in the subdirectory?

No. If someone goes to domain.com and my app is in domain.com/app it shouldn't redirect. This is whole thing is really only an aesthetic choice, not functional. The app works completely fine without doing this. Just curious is all.

Theme © iAndrew 2016 - Forum software by © MyBB