Mav2u Posted December 6, 2003 Posted December 6, 2003 I know there is a way to redirect to a index.htm or index.php or whatever using .htaccess file. I want to redirect from www.mysite.com to www.mysite.com/blog/ instead. I couldn't find the post I saw many moons ago in the forums, so I hope someone here can remember what the steps were for doing it. Thanks, Mav Quote
TCH-Andy Posted December 6, 2003 Posted December 6, 2003 Mav, in the FAQ section Setting up a web redirect Andy Quote
vertekal Posted December 8, 2003 Posted December 8, 2003 edit your .htacess and put a line like this: DirectoryIndex other_index.html where 'other_index.html' is the name of the file you want as your starting page. The downside is that this affects every subdirectory too. For example, my first page was named 'main.html' and the server expected it to be index.html. My .htaccess file was edited to say: DirectoryIndex main.html and that worked great, until someone went to www.mysite.com/subdirectory. In that subdirectory, the server would not recognize index.html as the main page. It was looking for main.html as specified in my .htaccess file. So, what you do is add a 2nd option in there, like: DirectoryIndex main.html index.html Meaning the server first looks for main.html, and if that's not found it looks for index.html. You can also add other entries too. I've not tried, but I assume that if you wanted www.yersite.com/blog/index.html as your starting page, you could do something like: DirectoryIndex blog\index.html But you might have to mess with the syntax to get it right (\blog\index.html or .\blog\index.html, etc) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.