PDA

View Full Version : Url name and redirect questions...



binomonkey
03-13-2008, 03:18 AM
Hey there,

Is there's a way to shorten or rename ones url name regardless of where one is on a site?
Let's say I load a file called "foo.php" that lies in a subdirectory called "foo" under "public_html."
My url looks like this: "www.mysite.com/foo/foo.php."
However, I'd prefer to have my url still read as "www.mysite.com." How is this done?

How about redirecting? I'm testing/playing with a few mock sites at the moment... So, I
have a few subdirectories setup that relate to different sites I'm working on.
My understanding is that a single domain has only one index.html or default page right?
If so, how would I set up my index file to look into a subdirectory for a start page
instead? Redirection? Or another way?

Any help is appreciated.

Thanks

Chella
03-13-2008, 08:26 AM
Your file should automatically appear as www.mysite.com/foo.php if you are uploading into your public_html directory, not www.mysite.com/foo/foo.php

If this is still the case, you may need to check your .htaccess file

binomonkey
03-13-2008, 12:12 PM
foo.php was uploaded to the subdirectory "foo" in this case.

Chella
03-13-2008, 02:18 PM
Sorry for misreading mate, I was in a rush this morning. In any case, I believe you can edit your .htaccess file, or just upload your files into public_html instead of the "foo" folder, but I'll let someone else clarify since I'm not entirely certain.

antoniuk
03-14-2008, 03:08 PM
You can go to your hosting control panel and change the DNS pointer to go the foo directory
points it to public_html/foo
When someone types in your url they will be taken to the foo folder but they will only see the main url in the browser address box but you may have to change the file name from foo.php to index.php for this to work. Also you could not have another file named index within the foo folder. Example you could have both an index.php and index.html file within the foo folder at the same time.