How to create a subdomain and receive parameters in JS?


#1

I’m trying to add a bunch of parameters into my website. So my Url would look like: “www.[website].com?[parameters]

Out of this, the parameters part would be processed by the javascript in my website. My website address is: “db-downloader.000webhostapp.com”.

If I try to visit a url with any parameter say “www.db-downloader.000webhost.com?query=true”, I’m redirected to: “error404.000webhost(.com)”. I don’t know why the page redirects instead of taking me to my website as the main domain name stays the same?

Can someone please help me, I’m new to web development! Also, sorry for wrapping up the .com's in parentheses uselessly, wasn’t allowed to put more than one link in the post!


#2

That’s not a valid URL. At a minimum, you need this:

www.db-downloader.000webhost.com/?query=true

That would request the default document from the web server, which is one of index.php, index.html or index.html. You probably want the first one, since you’re doing something dynamic.


#3

I’m trying to add at a time bunch of parameters into my website. So my Url would look like: “www.[website].com?[parameters]” Out of this, the parameters part would be processed by the javascript in my website


#4

Check this


#5

Use the get paramater of the url in javascript Get query string values in JavaScript In Javascript, how can I get the parameters of a URL string,hey start to look for parameters on the url from ? and also from the hash # . Then for each parameter they split in the equal sign


#6

You can even use PHP for that. Can you please explain what you really need to do?


Black Friday Sale 90% OFF
0
DAYS
0
HOURS
0
MINUTES
0
SECONDS
×