Forum Moderators: phranque

Message Too Old, No Replies

redirect index.html to /directory/index.html

         

ozstar

2:30 am on Aug 28, 2010 (gmt 0)

10+ Year Member Top Contributors Of The Month



HI,

Just need to know a simple but effective way to get all requests for the main root index.html to go to a /directory/index.php.

Thanks

oz

jdMorgan

2:49 am on Aug 28, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



For what purpose? (This greatly affects the implementation.)

Do you plan to link to it there, and expose that subdirectory in URLs and search results?

Jim

ozstar

3:37 am on Aug 28, 2010 (gmt 0)

10+ Year Member Top Contributors Of The Month



Hi,

I want it so that when the dom blahblah.com is requested it goes to the index.html is a sub directory where the site has been set up rather than have to re-setup the site in the root. No it doesn't matter that the sub is shown in the url when they are there, but it will not be in the advertised dom, just the dom.com.

Thanks

oz

jdMorgan

3:28 pm on Aug 28, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You're talking in riddles here and this is not clear. If you want a good answer, please take the time to describe the problem clearly.

Are you talking about something similar to the "Mass virtual hosting" implementation as described in the Apache URL Rewriting Guide?

Or are you talking about "sharing" the index.php script in the root filespace among all subdomain URLs so that you don't have to have multiple copies of it?

Jim

g1smd

7:47 pm on Aug 28, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You never want to be redirecting to a named index filename.

For index files, the canonical URL should end with either hostname and tailing slash, or else hostname, folder name and trailing slash.

But all the stuff that jd mentioned above, needs to be addressed first.

ozstar

9:33 pm on Aug 29, 2010 (gmt 0)

10+ Year Member Top Contributors Of The Month



Thanks guys.

I may have sent you up the wrong creek.. Sorry if thyat is so..

For a year I have had a 2 second refresh index.html file which redirects to a sub dir where there was another index1.htm which was in fact the main home page. It has worked fine.

Now I want the dom.com to go straight to this index1.htm and not go to the index in the root to redirect.

I hope that makes some sense.

oz

jdMorgan

12:31 pm on Aug 30, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



OK, so either link directly to example.com/directory/ on all your pages and externally redirect all requests for example.com/ and example.com/index.xyz to example.com/directory
Search engines will list you 'home page' as "example.com/directory/"

-or-

Link to example.com/ on all your pages and internally rewrite requests for example.com/ and example.com/index.xyz to example.com/directory/
Search engines will list your home page as "example.com/"

-or-

Link to example.com/ on all your pages and copy the /directory/index.php file to /index.php
Search engines will list your home page as "example.com/"

Note that in all cases, the search engine listing URL depends on where you link to from your pages, and not on anything we're doing on the server. What we do on the server affects what file that URL refers to, but not the URL itself.

Jim

ozstar

10:13 pm on Aug 30, 2010 (gmt 0)

10+ Year Member Top Contributors Of The Month



Many thanks for your time and explanation Jim. It is appreciated.

Regards,

oz