如何命名URL [英] How to name a URL

查看:129
本文介绍了如何命名URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将我的网站命名为www.abc.edu.pk/xyz
但是我被告知只能将其命名为www.abc.edu.pk/xyz.html
我该如何命名

I want to name my website as www.abc.edu.pk/xyz
But i was told that it can only be named as www.abc.edu.pk/xyz.html
How can i name it the first way?

推荐答案

MVC应用程序使用URL重写来做到这一点.希望这种方法对您有用.

[竖起大拇指]

MVC applications does so using URL rewriting. Hope that approach is good for you.

[thumbs up]


由于您已使用ASP.NET对此进行了标记,所以我想提到default.aspx的行为就像index.html一样,因为您可以指向父目录,并且该目录中的default.aspx页面将被自动使用.
Since you tagged this with ASP.NET, I thought I''d mention that default.aspx acts like index.html in that you can just point to the parent directory and the default.aspx page in that directory will automatically be used.


如果您使用的是apache查找mod rewrite
将所有请求重定向到基本页面并从那里构建页面


abc.com/car/toyota/2


您将拆分字符串类型=汽车品牌=丰田专页= 2,并使用这些值构建您的专页
******************************** ****************************
如果您使用的是静态html页面,则可以粗略地做到这一点

您可以使用每页的文件夹,并在其中放置index.html

例如,当abc.com/cars重新设置时,文件cars.html可以存储为/cars/index.html

显示带有清晰网址的/cars/index.html
if you are using apache look up mod rewrite
redirect all requests to a base page and build your pages from there


abc.com/car/toyota/2


you would split the string type = car make = toyota page = 2 and use those values to build your page
*****************************************************
if you are using static html pages you can do it crudely

you could use a folder for each page and put an index.html inside it

eg the file cars.html could be stored as /cars/index.html

when abc.com/cars is requseted it will show /cars/index.html with a clean URL


这篇关于如何命名URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆