Redirection Issues


#1

Hi I’m trying to redirect my site.

I have my domain www.jdhammercpa.com

I want to redirect it to www.jdhammercpa.com/bc

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?

Thanks


#2

also http://www.squidoo.com/301 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)


#3

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


#4

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


#5

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?


#6

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.


#7

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.


#8

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


#9

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.


#10

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

BEGIN WordPress

RewriteEngine On Redirect 301 /index.html http://www.jdhammercpa.com/bc 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?


#11

BEGIN WordPress

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

why am I still getting a 500 error?


#12

your redirect is malformed. just use this: http://www.htaccessredirect.net/


#13

OOPS, sorry mentioned already, so cancelled


#14

//301 Redirect Entire Directory
RedirectMatch 301 http://www.jdhammercpa.com/index.php(.*) http://www.jdhammercpa.com/bc/$1

still getting a 500 error


#15

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.


#16

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 http://arislondon.com to http://arislondon.com/blog. 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: http://wiki.dreamhost.com/Transparently_redirect_your_root_directory_to_a_subdirectory
I’ve tried Redirect 301 /index.php http://www.arislondon.com/blog
I’ve tried RewriteEngine on
RedirectMatch 301 http://arislondon.com http://arislondon.com/blog

I’ve tried the ‘Page A to Page B’ redirect listed here: http://www.squidoo.com/301 (same as above, just replacing “RedirectMatch” with “Redirect”)
I’ve tried:
RewriteEngine on
RewriteRule / http://arislondon.com/blog [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?


#17

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.


#18

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

Redirect 301 /index.html http://mysite.com/folder

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.


#19

I’m having the same problem. I have joomla install on

Mysite.com 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 http://mysite.com that will be my old site or I could of go to http://mysite.com/new and new site will come on. Today I tried to redirect http://mysite.com to be http://mysite.com/new I followed the instruction here http://wiki.dreamhost.com/Redirect_Domain so I when to Domain manager. Edit my domain, Redirect and inserted http://mysite.com/new 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. http://mysite.com non http://mysite.com/new 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 http://kallejeromusic.com/!

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!

Thanks,
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 mysite.com was hosted on another server but i transfered to dh a while back i don’t think this has to do with the error


#20

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
http://wiki.dreamhost.com/Transparently_redirect_your_root_directory_to_a_subdirectory

[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