Jump to content

How to let search engines first index and not the main.php page


gary4u

Recommended Posts

Hi,

 

I have created a index.html page for a Disclaimer and then after click go to the main.php file.

Can I know how to let search engines first go to the index and not the main.php page.

eg: If you type www.mywebsite.com  - then it will go to the index file. But if you type in the search engine like-

www.mywebsite.com  contact    - it goes straight to the main.php. Which I do not want it to go.

Can any help me regarding this.

 

Thanks

 

 

Link to comment
Share on other sites

Actually the problem is that your site lets users go directly to main.php. You need to make sure they go through index.html first.

You do that with a cookie and a redirect. Have index.html set a cookie. If main.php (or any other page) sees that the cookie is not set, it redirects to index.html.

Link to comment
Share on other sites

it just simple. When ever a user open the website it first go to the index.html. As this a Disclaimer info then after click IAGREE then it goes to the main.php.

This is the site  - www.letsarbitrate.com

But when I noticed that when a user types in any search engines the website name --www.letsarbitrate.com  contact    or   www.letsarbitrate.com   gallery or anything for that mattter. it goes to the main.php. Which I need to restrict it to the index.html that is the Disclaimer page after they click the " I Agree " then it should go to the main.php.

Link to comment
Share on other sites

That sort of thing is really better suited as a banner or popup on the page - not something separate to redirect with. Plus having it on the page means you don't have to deal with redirecting to or from it.

Code it into the page so it looks like you want. Use PHP to render it onto the page if the cookie isn't set, then use Javascript to set the cookie and remove the message.

Link to comment
Share on other sites

And I'm telling you, this redirect stuff is annoying so take the other approach that doesn't require redirecting.

Besides, if you already have some code in place then me giving you even more to throw at it won't help. What code do you have and what exactly do you mean by "it is not working"?

Link to comment
Share on other sites

Sorry for the later response.

<script type="text/javascript"> function loadNewDoc(){ window.location="http://www.letsarbitrate.com/index.htm"; } </script>

</head>

<body onLoad="setTimeout('loadNewDoc()', 5000)">

But there might  be a problem , whenever the page loads this script will run.

 

Link to comment
Share on other sites

Right. You need something smarter.

Whether you go with what I said or continue with this, you need to learn to use cookies. When the visitor sees the index.html page you must set a cookie indicating that they have seen it. Then on other pages you only redirect to it if the cookie isn't set.

But keep in mind what you're doing is bad for SEO. Either you present a popup or you don't let the visitor even see main.php at all and do the redirect from the server.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.