Welcome Guest, Not a member yet? Register   Sign In
Simple redirect problem
#1

[eluser]h0ly lag[/eluser]
On my website I have, *gasp* made of all things, a blog. Anyway, I'm already rewriting the URL's with mod_rewrite. Everything works great. Although there is one quirk I would like to try and fix. My website base dir loads my blog. But I don't want it to do that. I want it to redirect to /blog. Or at least look like it is. I have tried do simple .htaccess redirects amongst other things, but they don't seem to work properly.
#2

[eluser]Flemming[/eluser]
so you want it that if someone visits your site: http://mysite.com

that they get redirected to : http://mysite.com/blog

?
#3

[eluser]h0ly lag[/eluser]
Yes. But both the root dir, and /blog load the same page.

My tree is like this:

-mysite.com
--index.php
--system
--.htaccess
#4

[eluser]Flemming[/eluser]
This should do it then:

Code:
# if no page selected
RewriteRule ^$ http://mysite.com/blog [L]

EDIT: and set your default route (in config > routes.php) to 'blog'
#5

[eluser]h0ly lag[/eluser]
Brilliant! Thank you.

EDIT:
Waaaa! No IMG BBcode?
#6

[eluser]Flemming[/eluser]
cool! :-)




Theme © iAndrew 2016 - Forum software by © MyBB