开发者

Unsure about website address structure

In my websites normally I use Ajax, so the address is always something like

www.xxx.com for all pages.

But now I read and search in google and I cant understand how is made this type of site:

https://welshare.com/login

https://welshare.com/signup

If I change the address bar to login.php or asp or html the page gives an error.

So my question is, 开发者_运维问答how I can make something like that? is it htaccess? what is the login? a new page? a module?


If you are using apache as your server, you'll want to look into mod_rewrite. IIS also has an extension for this called URL rewrite.

Edit
To elaborate on how it works: Once you have your rules set up, it will look at the requested URL (say, mysite.com/test) and then on the server side, actually send a request to mysite.com/index.php?page=test. Whatever the output of the request is will be sent back to the user's browser and they will have no idea that that's actually the page that was requested.


mod_rewrite is the way to go. For a very easy to use tutorial click the link.

What is does in a nutshell is take a URL like http://www.example.com/index.asp?page=login and with the right parameters, transforms it into http://www.example.com/login

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜