I have a website which changes the content of the page depending on what the user puts into the url.
There is only one page, but it seems like there are more because of the .htaccess I have used.
The website goes
www.site.com/1 or www.site.com/482
the content then changes depending on what the url is, for example /1 would load content assigned to ID 1 and /482, load data assigned to that of ID 482.
My problem is when the user just goes to www.site.com the page still loads but the youtube clip on the page displays a fuzzy screen with the message 'invalid parameters' which is clearly unprofessional. I want the user to be redirected to a random page within my website (anything from /1 to /999) when they go to www.site.com (when there is no forward slash and a number).
I have this code:
var randomnumber = Math.round((Math.random()) * 999 + 1);
var DATA = window.location.pathname.replace('/', '');
if (typeof DATA == "undefined"){
DATA = randomnumber;
}
but it doesn't seem to change anything