2014-01-10 51 views
0

我看到很多网页(从主页开),很多网站没有格式,与http://www.apple.com/ios/如何创建一个无格式的网页?

它没有格式,与它不是http://www.apple.com/ios.html或任何东西。

即使这个页面是https://stackoverflow.com/questions/ask 它没有扩展名!

我该如何创建?

我有我的网站,我想的mysite/login.aspx的出现为mysite的/登录 同样的mysite/welcome.html为mysite的/欢迎

任何人都可以在那里帮助我吗?提前致谢!!

+1

如果谷歌这个,你会找到答案。 –

+1

看看htaccess和国防部重写 –

+1

尝试sreaching:URL重写 –

回答

1

它通常在Apache的.htaccess文件中完成。

事情是这样的:

RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)\.html$ /$1 [L,R=301] 

一拉this very similar question

0

如果你命名你的档案index.html(或index.php文件等),并上传到mydomain.com/test/index。 html,它将在mydomain.com/test/上可用

除此之外,通过htaccess文件使用url重写。 这里的a good tutorial让你开始。

0

把它放在你的.htaccess文件中。不要自己做,而是从你的FTP服务器上下载你的当前文件,改变它,然后上传并覆盖你的旧文件。

Options +FollowSymLinks 
RewriteEngine on 
RewriteCond %{HTTP_HOST} ^securemyhome\.com 
RewriteRule ^(.*)$ http://www.securemyhome.com/$1 [R=permanent,L] 

# 3 ---- Make pages render without their extension in the url 
Options +MultiViews 
相关问题