11 Replies - 527 Views - Last Post: 17 October 2013 - 09:55 AM

#1 bengie  Icon User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 94
  • Joined: 12-October 13

How to get ride of the 'index.html' at the end

Posted 17 October 2013 - 09:24 AM

Is there any way I have have a link which goes to my homepage but it doesnt show the index.html at the address bar?

Thanks in advance :)
Is This A Good Question/Topic? 0
  • +

Replies To: How to get ride of the 'index.html' at the end

#2 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3541
  • View blog
  • Posts: 10,236
  • Joined: 08-June 10

Re: How to get ride of the 'index.html' at the end

Posted 17 October 2013 - 09:28 AM

most web servers (Apache at least) usually show up the next resource that is named "index" (often "index.html") as a default setting. of course you can set any file name as the default file in the server configuration.
Was This Post Helpful? 0
  • +
  • -

#3 bengie  Icon User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 94
  • Joined: 12-October 13

Re: How to get ride of the 'index.html' at the end

Posted 17 October 2013 - 09:30 AM

I mean that i dont want it to come up with www.domain.com/index.html i want it to come up with www.domain.com


:)
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9204
  • View blog
  • Posts: 34,581
  • Joined: 12-June 08

Re: How to get ride of the 'index.html' at the end

Posted 17 October 2013 - 09:31 AM

.. like using 'mod_rewrite'?

https://httpd.apache...od_rewrite.html
Was This Post Helpful? 0
  • +
  • -

#5 bengie  Icon User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 94
  • Joined: 12-October 13

Re: How to get ride of the 'index.html' at the end

Posted 17 October 2013 - 09:32 AM

maybe, im not sure :)
Was This Post Helpful? 0
  • +
  • -

#6 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3541
  • View blog
  • Posts: 10,236
  • Joined: 08-June 10

Re: How to get ride of the 'index.html' at the end

Posted 17 October 2013 - 09:35 AM

for instance.

in Node it could look like that:
// using Express
app.get('/', function(req, res) {
    res.sendfile('index.html', { root: 'path/to/file' });
});


Was This Post Helpful? 0
  • +
  • -

#7 bengie  Icon User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 94
  • Joined: 12-October 13

Re: How to get ride of the 'index.html' at the end

Posted 17 October 2013 - 09:40 AM

this is gonna sound stupid but how do i incorpaerate that into my site? :)
Was This Post Helpful? 0
  • +
  • -

#8 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3541
  • View blog
  • Posts: 10,236
  • Joined: 08-June 10

Re: How to get ride of the 'index.html' at the end

Posted 17 October 2013 - 09:43 AM

the code example above only works, if you code your site using Node.js/Express. for languages like PHP, Java, ASP, JSP, etc. it is completely useless (as these languages need an additional web server to serve web pages).
Was This Post Helpful? 0
  • +
  • -

#9 bengie  Icon User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 94
  • Joined: 12-October 13

Re: How to get ride of the 'index.html' at the end

Posted 17 October 2013 - 09:44 AM

cool
Was This Post Helpful? 0
  • +
  • -

#10 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3541
  • View blog
  • Posts: 10,236
  • Joined: 08-June 10

Re: How to get ride of the 'index.html' at the end

Posted 17 October 2013 - 09:45 AM

coding a website in JS both on the client and the server is damn cool.
Was This Post Helpful? 1
  • +
  • -

#11 bengie  Icon User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 94
  • Joined: 12-October 13

Re: How to get ride of the 'index.html' at the end

Posted 17 October 2013 - 09:47 AM

sounds so!
Was This Post Helpful? 0
  • +
  • -

#12 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3541
  • View blog
  • Posts: 10,236
  • Joined: 08-June 10

Re: How to get ride of the 'index.html' at the end

Posted 17 October 2013 - 09:55 AM

a development stage server in Node.js using 100 lines:
Spoiler

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1