Is it possible to open a random index site when someone visit my domain?
For example I have index1, index2, index3 and so on. And now I want every time someone visit my homepage that he will be redirected randomly to one of those sites. Is there a way to realize this?
Yes of course. What language do you want to do it in?
Basically the first thing the page's controller would do is get a random number from 1 to 3 (or however many pages you have the option of), and then redirect to '/index'.$randomNumber by setting a redirect header
But for what we need redirect?
We need to send page for user only, so we can use:
instead of headers.
I think that we needn't generate excess traffic?
Good point Luno, I should have thought of that, 'cos I routinely use include files, just not on a "random" basis. Though I'm not sure of the effect on search rating bots of a variable home page, either way??? By the way, if you do substitute include() for header(), remember to remove the exit command as well. That is only needed by the header() command.
But with redirecting we will have the same situation when index.php will empty for search bots.
It will index index<n> file only.
If pages have one theme only, we can have index<n> files with BODY of pages only. So we will send header by index.php page (like desctiption, title etc.)
Yes, I was thinking along those lines. You only need to include the variable content, which is the opposite of what I use include files for: I include the standard content (headers, footers, sidebar etc...) to minimise the maintenance of the site. Update an include file, and every page that uses it changes. Indeed, in this case there is no reason not to do both, i.e. use include files for standard and variable content...