Forum Moderators: phranque

Message Too Old, No Replies

Redirect all browser traffic to index/root

Using mod_rewrite to redirect all queries to root

         

johnfr

11:25 pm on Nov 11, 2010 (gmt 0)

10+ Year Member



Hello,

I'm a complete beginner on Apache and especially mod_rewrite and turn to you for some needed advice.

Can it be done/is it wise to redirect all incoming traffic (human traffic) of a site to the "front page", I mean the index.php?
I want all users to FIRST end up on my front page of the site, and then navigate from there. As it is right now, certains links from google and other websites, points straight to other pages or other subdirectories on my site. This make the design screw up.

So I would like to redirect an incoming request for eg: "/gallery/page4.php" to "/index.php" or only "/"

Would this disallow access to these pages/directories even when navigating from the index.php?

What would happen in a case like this to Googles crawler? Would it still index everything (according to robots.txt?)

Thank you!


/ john

g1smd

11:52 pm on Nov 11, 2010 (gmt 0)

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



This isn't a good idea. You should instead have a link to "home" on every page of the site.

If you redirect requests for other URLs, those pages will
- never be indexed because search engines will be redirected elsewhere;
- will never be able to be viewed by anyone (unless you dream up some scheme using cookies - but even then you'll have a large percentage of people that will still never get to see any of your content).

You want as many pages as possible to be indexed by search engines. Most of your visitors should be arriving at an internal content page - the one that best matched the original search query.

Imagine doing a Google search, finding the exact product you wanted to buy listed in the SERPs, and then clicking the link. The click takes you to the site, but how would you feel if you then find you're on the home page, not on the page for the product you actually wanted? From there you would then have to work out where on the site the page you actually want is located. Many clicks later you might eventually get to see the content.

No. The correct operation is that when you click the link in the SERPs, you are taken directly to the correct page of the site.

jdMorgan

2:48 am on Nov 18, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A big part of Webmastering is to accept one fact: You are not in charge. You are the server (the servant), not the client (the master).

Instantly give the user exactly what he or she wants, and design your site to accommodate his/her every whim and foible.

But technically, yes, you could do this for visitors whose browsers were configured to accept cookies -- if you'd rather have control than happy users/profits/popularity (as applicable).

Jim