Redirect home page to blog


#1

I’ve been unsuccessfully trying to redirect my index page (http://www.hawleyfocus.com/) to my blog site (http://www.hawleyfocus.com/blog/).

I tried using the .htaccess file which has (along with various other suggestions from here):

Redirect 301 / http://www.hawleyfocus.com/blog/

I get this error message:
[color=#1E90FF]Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@hawleyfocus.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.[/color]

I’ve also tried changing the web directory to /blog on the end, but my css will then not work.

What else can I try to get this durned thing to work? I’ve been searching these forums for hours and trying all kinds of things to no avail.

PLEASE HELP!!
Jen


#2

If this is a WordPress blog, then changing the web directory should work as long as you go into wp-admin’s General Settings and update your site’s URL. In fact, that may be what’s throwing the wrench into your other approach as well.


#3

Hi Scott-

Thanks for the response. I tried that as well. When I changed the url in WP, then the site went down with this error message:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@hawleyfocus.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

Just to make sure we are talking about the same thing, I changed the web directory to be: /home/username/hawleyfocus.com/blog. Then I went into WP in the General Settings and changed the Site address (URL) to http://www.hawleyfocus.com/ which resulted in the above error. When I leave in WP as hawleyfocus.com/blog, I get the website to redirect to hawleyfocus.com but their is no CSS.


#4

I tried this unsuccessfully as well: http://wiki.dreamhost.com/Transparently_redirect_your_root_directory_to_a_subdirectory

It basically says create an htaccess file with this info:

Options -Indexes +FollowSymlinks
RewriteEngine on
RewriteBase /

RewriteCond %{REQUEST_URI} !^/cms/

Don’t apply to URLs that go to existing files or folders

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

Rewrite all those to insert /folder

RewriteRule ^(.*)$ /cms/$1 [L]

I changed all occurrences of cms to blog which is what it says to do. Still getting the 500 Internal Server Error:([hr]
Ok, got it to work. I had to copy/paste the htaccess code directly into dreamhost’s online FTP and save the file directly there. So apparently, something was getting lost in translation. All works as it should now. Thanks for your help.


#5

All is working now. Just had to make the htaccess file directly on the online FTP.


#6

I hate to make a new post with the same problem, so hopefully I can tag onto this one.

I have set up the .htaccess file as instructed but when it redirects from www.eggofshame. com instead of going to www.eggofshame. com/blog/ it tries to go to

http://www.eggofshame. com/blogblogblogblogblogblogblogblogblogblogblogblogblogblogblogblogblogblogblog

any hints?

my .htaccess file:

Options -Indexes +FollowSymlinks
RewriteEngine on
RewriteBase /

RewriteCond %{REQUEST_URI} !^/blog/

Don’t apply to URLs that go to existing files or folders

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

Rewrite all those to insert /folder

RewriteRule ^(.*)$ /blog/$1 [L]


#7

do you have any other lines in your .htaccess?


#8

I keep answering this same question over and over.


#9

I think you are saying i should add the line

Redirect 301 /index.php http://www.eggofshame.com/blog

to my .htaccess file.

Does it matter where I put this line?

should this work?

[quote]Options -Indexes +FollowSymlinks
RewriteEngine on
RewriteBase /

RewriteCond %{REQUEST_URI} !^/blog/

Don’t apply to URLs that go to existing files or folders

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

Rewrite all those to insert /folder

RewriteRule ^(.*)$ /blog/$1 [L]

Redirect 301 /index.php http://www.eggofshame.com/blog
[/quote]

Bobocat, currently what I posted before is all that is in that file.

FWIW Now eggofshame.com seems to not be going to blogblogblog but back to the dreamhost default page. Ussure if that is progress or not.


#10

just change [L] to [L,R=301] which is the shorthand way of saying ‘use this rewrite as a redirect’


#11

Is this right?

[quote]Options -Indexes +FollowSymlinks
RewriteEngine on
RewriteBase /

RewriteCond %{REQUEST_URI} !^/blog/

Don’t apply to URLs that go to existing files or folders

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

Rewrite all those to insert /folder

RewriteRule ^(.*)$ /blog/$1 [L,R=301] [/quote]


#12

Redirect 301 /index.php http://www.eggofshame.com/blog is all you need in your .htaccess and nothing else. it will work. as i have said in a different thread i have not tested this if an index.php (or html etc) file was not there but if not just create a blank one.


#13

If all one needs to do is put

Redirect 301 /index.php http://www.eggofshame.com/blog

in .htaccess, why does the wiki give such different instructions here:

I just did the simple one line redirect and it works great after I finally found the quickstart file and deleted it. I thought it would have been in the top lvl directory but it was in /blog/ /shrug

Maybe someone should try to edit that wiki page, it seems to be sending enough newbies to the forums with questions.

Regardless, thanks for the help!


#14

Well there are a few different ways you can do a redirect depending on your situation. What I listed was to redirect one particular page to somewhere else. Its just that the server looks for the index file first by default so you don’t have to type mysite.com/index.html to view it. So by adding a redirect rule for the index file will send people to wherever else you have specified if all they type in is your main domain. However that only works if someone is typing mysite.com and it will give them a 404 if they type mysite.com/otherpage.html for example. Here is a very good page about redirects and it lists different scenarios for what someone might want to be doing.