[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 233
  • Last Modified:

index.php to domain name only

I know that there is a way to rename files, but since I'm not a programmer, I'm not sure what's required.  For now, I need to create an index.php (it must be php because I want some news feeds on it and I'm using php code to get them there), but I don't want the url to be www.mydomain.com/index.php.  I want it to be simply www.mydomain.com 

Can someone tell me (carefully, cuz I don't really know about php but I sure can follow instructions) what to do to make this happen in a manner that will please the search engines?

  • 2
1 Solution
a very simple way is to use www.mydomain.com in your links, not index.php. Apache always search for index page, and doesn't show it the url. many web servers do that as well. you'd notice that when you type any url of any site, say www.cnn.com, you won't see index.php
index.php will show when u use a link that links to it e.g. <a href = "index.php">home</a> if u change this to
<a href = "www.mydomain.com">home</a> it should do it

there is a more advanced way, using apache mods, which can omit the file name alltogether. if u need that method, i'll give u all details
linqueAuthor Commented:
I *am* interested - if you don't mind - maybe a straightforward tutorial or else a general explanation so I could try to understand.  Anyway, I will accept your current answer and thank you
there is a way where apache handels this quite well, e.g.
http://www.mysite.com/deep/stuff/very_complicated_url?text=sometxt //<- long url

is considered as http://www.mysite.com/anything

this search engin friendly and easy to remomber by users. this is done via mode rewrite in apache. here is a nice article regarding this issue


Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now