• 0

Hide file name after domain address


Question

I'm working on a website and the CMS that i work with directs the address to a php file after i type the domain name.

Is there a way to show only the domain name like www.domain.com instead of www.domain.com/index.php?

Thanks.

Link to comment
https://www.neowin.net/forum/topic/850026-hide-file-name-after-domain-address/
Share on other sites

9 answers to this question

Recommended Posts

  • 0
  M2Ys4U said:
Absolutely! If you're using Apache, mod_rewrite is probably what you need!

Hmm, any easy was to do it?

I host it with a hosting company and not sure i have access to the apache server there. :huh:

  • 0
  V-Tech said:
Hmm, any easy was to do it?

I host it with a hosting company and not sure i have access to the apache server there. :huh:

You don't need full access to the sever... you just use mod_rewrite within a .htaccess file (it does say this on the link provided in the summary) and it is the easiest/best way to do it.

You may have to read up for 15 minutes on it, but if you want pointing in the right direction.... .htacess and mod_rewrite is where to look.

Edited by lt8480
  • 0

Assuming that your web host set up your account properly, you should just be able to type it in as "http://www.mydomain.com". When the web server sees that address, it will open "index.php" by default. If it can't find "index.php", it will try different page names such as "index.html", "index.htm", until it finds one to load.

For example:

==========================

[simple Example]

You type into your address bar: "www.domain.com"

The web server will load: "www.domain.com/index.php"

------

[Example with query string]

You type into your address bar: "www.domain.com/?query=value&q2=v2"

The web server will load: "www.domain.com/index.php?query=value&q2=v2"

------

[Example where page is in sub-directory]

You type into your address bar: "www.domain.com/aboutme"

The web server will load: "www.domain.com/aboutme/index.php"

==========================

Assuming that your web host set up your account correctly, it should do all of this automatically, if you don't specify a filename, it will always look for index.* to load by default (if you're using a Windows server, IIS is usually configured to look for default.* as well). I know my web host set my account up this way.

  • 0
  Majesticmerc said:
Assuming that your web host set up your account correctly, it should do all of this automatically, if you don't specify a filename, it will always look for index.* to load by default (if you're using a Windows server, IIS is usually configured to look for default.* as well). I know my web host set my account up this way.

Yes, but only for index and for things you have created yourself... but:

  Quote
I'm working on a website and the CMS that i work with directs the address to a php file after i type the domain name.

The CMS they are using shows the full url, I think their index was just an example, and they probably want to do it to other pages. In which instance the "default" will be of no use.

The reason for this may be to hide file locations... I know I do this, and I also use .htaccess to set me home page to something other than index.php/html/htm

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

  • Recent Achievements

    • Experienced
      dismuter went up a rank
      Experienced
    • One Month Later
      mevinyavin earned a badge
      One Month Later
    • Week One Done
      rozermack875 earned a badge
      Week One Done
    • Week One Done
      oneworldtechnologies earned a badge
      Week One Done
    • Veteran
      matthiew went up a rank
      Veteran
  • Popular Contributors

    1. 1
      +primortal
      684
    2. 2
      ATLien_0
      266
    3. 3
      Michael Scrip
      196
    4. 4
      +FloatingFatMan
      181
    5. 5
      Steven P.
      142
  • Tell a friend

    Love Neowin? Tell a friend!