Redirection Issues

Hi I’m trying to redirect my site.

I have my domain

I want to redirect it to

I have tried the 301 redirect but I must be doing something wrong because I keep getting errors. Can someone please tell me exactly what I need to do?


also for all your 301 redirect needs

(i wish i knew why people don’t bother to actually do a search on the message board for this… its been answered a zillion times)

Because Dreamlings writing their first posts know that some kind soul like you will sigh and just give them the answer anyway :slight_smile:

Because I read that website and am still confused. I also can’t find my .htaccess file. I am very confused.

If you cannot see the .htaccess file then you need to change the preferences of your ftp program to show hidden files. didn’t you say you tried to do a 301 redirect so how can you not have found it? just how did you try to do the redirect then?

I tried to create my own using what I saw on the Squidoo page. I have my ftp program set to show hidden files. I just cant seem to find the .htaccess. Is it different when you are redirecting to a wordpress database? Thanks.

Normally .htaccess will sort to the top of an ftp clients file listing, and as pointed out invisible files must be turned on.

.htaccess is a file that exists in a directory and can be edited. it’s existence is not required but if it exists apache will read it and follow the rules created within for the current directory and any directory below in the file tree.

The only invisible files I see are .cshrc .bashrc .bash_profile .alias

It possible than none yet exists, just create it like you would any file. On a windows machine however you can’t name a file .htaccess so i just name it htaccess upload it and then use rename in the ftp client to give it a . in front.

Look above and below in your directory structure as well, it’s possible to have more specific .htaccess files at different levels in the file structure.

Ok so I think I have located it. I edited it to say

BEGIN WordPress

RewriteEngine On Redirect 301 /index.html RewriteBase /bc/ RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /bc/index.php [L]

END WordPress

And I’m getting nothing. Any ideas?

BEGIN WordPress

RewriteEngine On RewriteBase /bc RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] Redirect 301 /index.php # END WordPress

why am I still getting a 500 error?

your redirect is malformed. just use this:

OOPS, sorry mentioned already, so cancelled

//301 Redirect Entire Directory
RedirectMatch 301*)$1

still getting a 500 error

Are you trying to write a comment with the “//” bit? Apache doesn’t use that format, and it’s probably barfing on that — use “#” to demarcate comments in your .htaccess.

Not sure whether changing “//” to “#” worked for MHammer, but I’m not getting any of these solutions to work for me. Perhaps one of you knows what I’m doing wrong.

I’m trying to redirect to I have tried several alternatives, all of which either give me a 500 error or redirect to /blogblogblogblog…

I’ve tried the solution listed here:
I’ve tried Redirect 301 /index.php
I’ve tried RewriteEngine on
RedirectMatch 301

I’ve tried the ‘Page A to Page B’ redirect listed here: (same as above, just replacing “RedirectMatch” with “Redirect”)
I’ve tried:
RewriteEngine on
RewriteRule / [R=301,L]

What am I doing wrong?

One other thing - right now I have the domain set up to work with both the “www” in front and without. Do I need to switch that to “www” only for the redirect to work?

Don’t forget that matching strings depends on where you start and end the comparison.

Apache usually does prefix matching unless you use a regular expression (where available) to indicate the match should include the end (or beginning) of the string.

In other words you will find “abc” in “abcdef” but you will not find “abc” in “abcdef”

And as such if you look for “/” in “/blog” you will find it, and as a result will end up in a recursive loop on the same hostname.

What you want is very simple if you have but want things to automatically forward to In your home directory create a file named .htaccess and just put this in it:

Redirect 301 /index.html

That’s it. Nothing extra. Period.

If you just put / without index.html (.php,etc,whatever) you will get infinite loop. If you had that (but tried other things before) and it wasn’t working it was possible you were having a cache issue so would need to clear cache and try again but that does work.

I’m having the same problem. I have joomla install on now i have installed a new jommla site on a directory I create inside first joomla root. everything was working fine so i was able to go to that will be my old site or I could of go to and new site will come on. Today I tried to redirect to be I followed the instruction here so I when to Domain manager. Edit my domain, Redirect and inserted DH panel say it will take 5-10 minutes for the change to take effect. I waited and waited and nothing. So now non of my site are working. non I went back into the Domain manager and de-activate redirect. doing this de-activate my domain and I got this massage upon saved it.

We have now deactivated!

Within a few minutes it will give a “bad_httpd_conf” error, and within a day or so it won’t resolve at all in your browser.

If you’d like to re-add service, just come back to this page!

The Happy DreamHost Web Service Deactivating Robot!

So i came back and add the mysite domain again. now the domain said its fully hosted at Dreamhost but when i click visit the page on my domain manager I get a 404 error Any Idea? I want to try to set it back the way it was and maybe using another method to re-direct my page.

By the way was hosted on another server but i transfered to dh a while back i don’t think this has to do with the error

Ok after reading and trying all the step you tried I finally got it to work. Its take a long time to redirect so Im still trying to figure out why but this is what i did.

I used this step

[code]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][/code]

NOTE: RewriteEngine on was already on my htaccess so I removed for this come. now where it say cms that you want to change it to the directory you want to point the Redirect to. I left “rewrite all those to insert /folder” no change made to that.

Now very important because this is where I had problem even after doing this. If you are using a cms (Content management system) Like me im using joomla. you HAVE TO CHANGE THE Configuration.php file look for that configuartion.php file in your root of the cms and change this line

that was it once i did that now when i go to my main site it redirect me to the new one. Hope this work for you and for some other.

Ok i just tried this other method
301 Redirect
Using the 301 Redirect a Folder to a New Location, But Leave its Contents In-Tact

so I changed all the preview code from before and just added this

And this also since to work fine. Remember the Key here was my configuration.php on joomla that need to be change

Which way its better hmm I don’t know if anybody know please let me know. I don’t want to lose traffic and i want to keep search engine happy