PDA

View Full Version : Getting rid of index.php?


iceman11111
05-08-2004, 11:43 PM
How do you get rid of the index.php? in the url?

I would like my URL to read:
http://www.women4fitness.com/forums/

not
http://www.women4fitness.com/forums/index.php?


I find, that by doing this I get a better PR on google for my forums page.

Could someone please point me in the right direction.


Thanks
Iceman

kall
05-09-2004, 09:52 AM
AFAIK, if google *could* see /forums/, it would be the list of directories and files in that directory...not what it sees when it goes to /forums/index.php

If I'm incorrect, someone please say.

Hialls
05-09-2004, 11:00 AM
Its possible i believe you just edit apaches httpd.conf and remove *.php for root directory therfore even if index.php exists it will just show a list of files, but index.php will still be viewable

iceman11111
05-09-2004, 03:29 PM
Here's an example of my other site (using Vb2)

http://www.intense-training.com/forums/ (has a 4/10 PR)
http://www.intense-training.com/forums/index.php3?s= (has a 0/10 PR)

But the funny thing is, they are the same page!


Google just seems to except a cleaner, shorter link!

I know it has something to do with the htaccess and re-write rules, I just forget how I did it all!

iceman11111
05-10-2004, 02:13 PM
bump!

dstruct2k
05-10-2004, 03:31 PM
Uhhh... most Apache servers that have PHP installed on them have "index.php" set as one of the root files shown, so pointing all links to "/forums/" will automatically link to "index.php" (or index.html first if it exists)


Just alter your links. The php file should stay where it is.

allan grossman
05-10-2004, 04:36 PM
Uhhh... most Apache servers that have PHP installed on them have "index.php" set as one of the root files shown, so pointing all links to "/forums/" will automatically link to "index.php" (or index.html first if it exists)


Just alter your links. The php file should stay where it is.
To elaborate just a little, look at the 'DirectoryIndex' setting in httpd.conf - either as a global setting or a virtual server setting ;)

pjdaley
05-10-2004, 08:01 PM
subdomain wouldn't hurt.

instead of mysite.com/forums
it would be

http://forums.mysite.com

pjdaley
05-10-2004, 08:02 PM
that of course would mean, no index.php... but u might want to look into that

iceman11111
05-14-2004, 04:35 PM
well there is a way to do it via htaccess

But I am not really up on my rewrite rules

Can anyone help out?

Mr. HillBilly
05-15-2004, 01:59 AM
Try this, Make a .htaccess file and put this into it,


<Files index>
ForceType application/x-httpd-php
</Files>

DirectoryIndex index index.html index.php


Save and upload the .htaccess into your forum folder.

Let me know if it works.