0

I saw many websites with many webpages(apart from home page) with no format like http://www.apple.com/ios/

It has no format like it is not http://www.apple.com/ios.html or anything.

Even this page is https://stackoverflow.com/questions/ask It has no extensions!!!

How do i create that??

I have my site in which I want mysite/login.aspx to appear as mysite/login Also mysite/welcome.html as mysite/welcome

Can anyone out there help me?? Thanks in advance!!

Community
  • 1
  • 1
  • 1
    If you Google this you will find your answer. – John Conde Jan 10 '14 at 17:01
  • 1
    look into htaccess and mod rewrite – Kai Qing Jan 10 '14 at 17:02
  • 1
    Try sreaching: URL rewriting – Itay Gal Jan 10 '14 at 17:02
  • 1
    Well, technically, the `ios` link *does* have a `.html` extension, just not the way you accessed it. See http://www.apple.com/ios/index.html. Most servers will server `index.html` when accessing a directory (eg, `/ios/`). – 0b10011 Jan 10 '14 at 17:04
  • @KennyThompson - this is a little misleading, I help maintain many websites, none of them built on an MVC framework, all of them using `.htaccess` for URL rewriting – ChrisW Jan 10 '14 at 17:08

4 Answers4

1

It's usually done in the .htaccess file in Apache.

Something like this:

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

a-la this very similar question

Community
  • 1
  • 1
itamar
  • 3,837
  • 5
  • 35
  • 60
0

If you name your file index.html (or index.php etc) and upload it to mydomain.com/test/index.html, it will be available at mydomain.com/test/

Other than that, use url rewriting via a htaccess file. Here's a good tutorial to get you started.

James Hibbard
  • 16,490
  • 14
  • 62
  • 74
0

Put this in your .htaccess file. Do not make your own but download your current file from your FTP server, change it and then upload and overwrite your old one.

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
GrayJ
  • 96
  • 7
0

For IIS webserver,

install to IIS the "Url Rewrite" Module, "add rule" and follow the wizard.

download Url Rewrite

About Url Rewrite

ooopsoft
  • 410
  • 2
  • 6