Redirect and .htaccess not clear to me

As will become clear, I am not an experienced Apache user.

I had a video blog, on TypePad. It worked well, but the software was limiting.

I developed a joomla site on on DH so I
could learn Joomla and work out some problems with video pop-ups.

Once I got everything set, I wanted to use the domain on
DH with Joomla. After a lot of grief, I managed, through the forum,
to get running on DH.

There is now no problem at all with the DH domain

BUT as many times as I have tried to redirect to it does not work. I tried everything I could through the DH Panel.

You can type and that is what you will get.
I want it so that when you type it will take
you to

I don’t know how to make this any clearer.

I now think it may be a problem with .htaccess somewhere or something I do
not understand about the DH Panel.

I got a response from DH Support:

Now this is all well and good, but I do not believe I am redirecting filenames and I do not know that I want to limit the redirect to a filename in case someone types in a more complex link referring to specific Joomla content. There are, in fact, links to content. (I don’t know whether they are files in the mySql database.) For example, a popular link is:

I want this to be redirected to

In some Googling, I came up with variants on

RedirectMatch permanent ^/$

As you can see, this is clearly not the DH wiki recommends.

And, if I do add this to my .htaccess file, which one do I put it in? The one in Just that? Do I leave all the other stuff in?


Sorry that this is so long, but as it is a public forum I hope that some information can be shared with other newbies like myself.


[quote]For example, a popular link is:

I want this to be redirected to[/quote]
This excerpt (from an excellent resource on using .htaccess, published by Earthlink/Mindspring, should point you in the right direction:



Syntax: Redirect [ status ] url-path url

The status argument is only available in Apache 1.2 or later.

The Redirect directive maps an old URL into a new one. The new URL is returned to the client which attempts to fetch it again with the new address. Url-path a (%-decoded) path; any requests for documents beginning with this path will be returned a redirect error to a new (%-encoded) url beginning with url.

Redirect /service

If the client requests http://myserver/service/foo.txt, it will be told to access instead.

Note: Redirect directives take precedence over Alias and ScriptAlias directives, irrespective of their ordering in the configuration file. Also, Url-path must be an absolute path, not a relative path, even when used with .htaccess files or inside of sections.

Returns a permanent redirect status (301) indicating that the resource has moved permanently.

Returns a temporary redirect status (302). This is the default.

Returns a “See Other” status (303) indicating that the resource has been replaced.

Returns a “Gone” status (410) indicating that the resource has been permanently removed. When this status is used the url argument should be omitted.

Other status codes can be returned by giving the numeric status code as the value of status. If the status is between 300 and 399, the url argument must be present, otherwise it must be omitted. Note that the status must be known to the Apache code (see the function send_error_response in http_protocol.c).


Syntax: RedirectTemp url-path url

This directive makes the client know that the Redirect is only temporary. (Status 302). Exactly equivalent to Redirect temporary


Syntax: RedirectPermanent url-path url
Context: directory, .htaccess

This directive makes the client know that the Redirect is permanent. (Status 301). Exactly equivalent to Redirect permanent [/quote]
Translating the above to your situation:

RedirectPermanent /joomla

when placed in an .htaccess file located in the “base” directory of (the directory within which the “joomla” directory resides), will cause the following to take place:

If the client requests , it will be told to access

Which is what I believe you want to do.

Place it in the “top” web accessible directory of shirson.dom (on Dreamhost, the directory is probably named “”). As .htaccess files impact all directories below them in the directory tree, that is all that is needed to impact the “joomla” subdirectory of Once this is done, there is no need to leave anything in the joomla sub-directory (that means files, and other directories). Test it first to make sure it is working as expected, then you delete all the other stuff.

This method works particularly well in your situation, because you should not experience any google penalty for doing it this way, and users that have existing links won’t be left “stranded”. Additionally, this allows you to go ahead and further develop with freedom (just make sure and leave that line in whatever .htaccess file you ultimately end up using in the directory. Good Luck, and let us know how it all works out. :slight_smile:


Just create a file names index.php with this one line

<?php header('Location:'); ?>

and place it here

Then will redirect to very quickly

That’s a good “quick” way to redirect to the main page of his new site, but will it preserve the routing for urls that point to specific content? :wink:


No but just also ass a missing.html file

I understand. The reasons I suggested the RedirectPermanent .htaccess method were so that he could:

  1. Have urls that point to a specific piece of content be redirected to the desired content.

  2. To avoid potential penalty issues with Google and the types of redirects that are often used for “cloaking” or other “search engine gaming” schemes (such as when a webmaster uses “” from numerous domains that all point to the same content

  3. Avoid the overhead of spawning an additional process (php.cgi)

It’s not that your suggestion is not a good tool to have in your “bag of tricks”, and I’m glad you shared it; I just think he is better served in this instance using a .htaccess redirect (of course, YMMV and there are many ways to “skin this cat” :slight_smile: )


I agree
My method is easier and it works.
I am not sure if it’s better

Worked like a charm!

I put in the .htaccess and had to leave for a few hours and found from my stats that the various urls came through perfectly.

I took rlparker’s advice

[quote] RedirectPermanent /joomla

When placed in an .htaccess file located in the “base” directory of (the directory within which the “joomla” directory resides), the following will cause the following to take place:

If the client requests , it will be told to access [/quote]
They all came through fine!

Very neat solution. So far, so good!

Thanks, all for your help.


I noticed that the www version of your site is a PR 3 and the non-www version is PR 1. If you care about Google PR, two more easy little things you might want to do:

  1. Add the www to that line, making it redirect to, instead of

  2. In the panel, choose to add the www even if it’s not typed in.

The 301 redirect will pass the PR to the www version and won’t be affected if people link to you without the www.

:stuck_out_tongue: Save up to $96 at Dreamhost with ALMOST97 promo code (I get $1).
Or save $97 with THEFULL97.


Those are really nice tips! I tell you, it’s a “trick a minute” to try to stay where you want with google! Of course, if you pay any attention to the guys at, they would probably suggest just waiting till the “no-www” catches up in page rank. :wink:

It would be interesting to see if a concerted effort to always become linked without the “www” would eventually garner the same, if not higher, page rank for the “no-www” address as that enjoyed by the “www” one…I suspect that the “old habits die hard” rule is likely to come into play though, as others will probably still include the “www” when linking to you no matter what your efforts are to get them to do otherwise :open_mouth:

At any rate, thanks again for the good tips!


And I made the changes and everything seems to be working fine!

I’m thrilled!

Thanks a lot, guys.l


You can throw it either way and Google won’t care about whether there’s a www or not… but if one already has more PR, I usually just go with that version, since that’s where most of the links seem to be pointing.

I have sites that redirect both ways, so I’m not fanatical about either version.

I usually go with www for business sites, or sites that advertise offline, because I think the www screams “Website!” to the average person. Example:

In that case, you instantly read it as a website, rather than a business name. The second one will seem like a business name until you hit .com at the end. Personally, I’ve noticed that with T-shirts, a www. catches my eye.

Another advantage in the offline example is that the www gives the name more of a centered look. That can come in handy for business card/letterhead layouts, etc…

:stuck_out_tongue: Save up to $96 at Dreamhost with ALMOST97 promo code (I get $1).
Or save $97 with THEFULL97.

All very good observations, and I agree. I think to some degree, the no-www types are kinda like those that get crazed if you end a sentence with a preposition :wink: .


One more thing!

Everything is working so well I don’t want to “fix” it! But my Google Analytics stats are being taken from the old url, and very rarely from which is what I want it to be using. I should close down and I wonder if I can do it just by renaming the folder, something else. That way, I can easily restore it by renaming it. In the event that it all works, then I would delete the folder.

I want to point out that one of the confusing things about working on this system is that I don’t see the applications program in the hierarchy. So I can’t just rename a joomla.exe joomla.old the way I could on a PC.

Am I understanding this? I would like some confirmation before I pull the plug!

Thanks for all,



Renaming the directory (“folder”) is fine, though I see no reason at all to even maintain the .old directory (it was there as a “backup” in case your upgrade failed, from weeks ago, and it didn’t :wink: ).

Once you have assured yourself that everything still works after the rename, you can delete the directory; all your “Joomla! stuff” is on

You generally won’t see “.exe” files here, as your “application” is the collection of files that are part of the Joomla! installation. Deleting the directories’ contents, and the directories, deletes the “application.”

One last suggestion I have for you though: If you don’t want visitors to to be able to browse the directories containing your videos, images, and tools, you need to disable directory listing for that directory (you can search the wiki for that) or, as is more commonly done, put an index.html (or index.php, etc.) file in your “” directory as described in this Dreamhost Wiki Article on Getting Started.