Redirect Main Page to Folder?

xd3vilx

Verified User
Joined
Jan 29, 2008
Messages
5
I would like to redirect mydomain.com to mydomain.com/portal when people visit my site through my main domain. Sorry for the poor explaination.
 
Go to the User Level and then click on Site Redirection under Advanced Features. Fill it in like this:

Local URL Path domain.com: /
Redirect Type: 301 Permanent
Destination URL: http://www.domain.com/path/

Then click Save to add it. Don't forget the trailing slash. :)

pretty shure the trailing / is nonsense, you can specify any url
but if you likt the / just do it
 
Actually, it's not. The problem is that most of the time, developers don’t even realize that they’re needlessly taxing their server (even if it’s just a little bit).

Let’s look at an example link:

Code:
http://somesite.com/subdirectory

This appears to be good; you’ve got your http://, you’ve got your URL, and everyone’s happy, right?

Right?

Not entirely. The process goes a little something like this, depending on your server and setup:

Browser: Give me ‘subdirectory.’

Server: Just a minute; first I’ll try to find a file called ‘subdirectory.’ ... Wait a second; it’s not there! How about a directory called ‘subdirectory?’ ... Ah, here we go. Okay. And next time, please use a trailing slash.

Browser: Roger that.

But by changing our link just a little bit:

Code:
http://somesite.com/subdirectory/

...everything becomes hunky dory. The server won’t have to guess whether ‘subdirectory’ is a subdirectory or a file; it will know.

Why should we bother? Because:
  1. We’re doing ourselves a favor, as this is the correct way to do things.
  2. We’re doing our server a favor, as this means less disk access, less bandwidth, and less load on the server.
  3. And most importantly, we’re doing our visitors a favor because they’re no longer losing a few seconds while our server tries to find first a file and then a directory. And in this industry, you and I both know that a few seconds is a long, long time.
You can search Google for more information on this topic, but here is one article that I found: http://www.nicemice.net/amc/soapbox/directory-URLs.var

I hope this helps.
 
I believe Jeremy is correct regarding the /. Under apache, mod_dir handles this automatically if you forget the /.
 
What exactly are You running in http://www.sgimpact.org/portal/ ?
If it is a CMS system of any kind Your problem might be in the CMS configuration. ;)
I am running Joomla as my CMS. I did not play with any configuration, can't think of anything I have done to cause this. Without the redirect function from DA, I can access the portal without a problem from sgimpact.org/portal.
 
GXX,

Yes, Jeremy's scenario is exactly what mod_dir is doing. And yes it takes time, and requires multiple hits.

xd3vilx,

If you're typing in the redirect properly, including the trailing slash where required, then the problem appears to be part of Joomla. I've never seen it before, though. Have you tried asking on a Joomla forum?

Have you tested? Create a directory under public_html: testdir/

inside testdir put an index.html file with only one line
Then create the redirect to testdir/ instead of to portal/

Does it work right, displaying the line:

If so, then the problem is with something in the Joomla configuration.

Jeff
 
Back
Top