Re: Rename index.php

Started by 1Chope, June 19, 2009, 08:32:11 PM

Previous topic - Next topic

1Chope

Quote from: JBlaze on May 13, 2009, 12:12:13 AM
You have to rename index.php as well...
Which index.php files will be edited??
I renamed it to a simple directory - nigeria,instead og index.php
It keeps on giving me error 404,there are many index.php files here.index.php file will be renamed?

[Core]


H

QuoteWhich index.php files will be edited??
The index.php file in the main forum folder
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

1Chope

QuoteThe index.php file in the main forum folder
But I Think If You do it, The site will Not be able to Locate the Index file.
Eg If you change the file to  yoursite.com/forum.php,
Lets take you use your forum as the root ,if you visit www.yourwebsite.com. No Index file will load so it have to show all the files in the root.
This will only work if you go direct to www.yourdomain.com/forum.php .Or Am I confusing?
I will also like to make my forum locate both the change folder and the index.php file can you check this example

  www.nairaland.com/index.php

          and

         www.nairaland.com/nigeria

Both of them are working.
How can I do This??

N3RVE

Indeed, most servers are configured to search for index.htm(l), index.php, so if you rename index.php to forum.php, the server wouldn't pick that. How about creating an index.php with a permanent redirect to forum.php?

As for nairaland.com/nigeria, you can also create that directory and place a redirect using a php script or a .htaccess file.

-[n3rve]
Ralph "[n3rve]" Otowo
Former Marketing Co-ordinator, Simple Machines.
ralph [at] simplemachines [dot] org                       
Quote"Somewhere, something incredible is waiting to be known." - Carl Sagan

1Chope

I hates redirects - reason-Google hates it ( You know I can't disobey Big G). Nairaland Guy understood this that's why here Disallow Google to follow nairaland.com/nigeria

The Php script can be something like this

<?php
header( 'Location: http://mysite.com/forum.php'; ) ;
?>

I will rename the index.php  to forum.php
create new file called index.php and upload this my script

In the robots.txt  I will do this

User-agent:*
Disallow:/index.php ( to avoid the redirect that Google hates)
and will add other valuables.

Do I get the script??


N3RVE

I had to split the topic as we were going off topic there :)
Origin Topic: http://www.simplemachines.org/community/index.php?topic=58439.0


The robots.txt protocol is a convention to control robot behavior on your site (the initial purpose of this protocol was only to prevent some or all of the robots from spidering particular parts of a web site), the file should be placed in top level directory within your site.

Your script would work fine, perhaps, what the nairaland guy has done is use a script like:

User-agent: *
Disallow: /nigeria/
Allow: /private/some-public-docs/


Your script should be something like:

User-agent: *
Disallow: /index.php
allow: /forum.php


-[n3rve]
Ralph "[n3rve]" Otowo
Former Marketing Co-ordinator, Simple Machines.
ralph [at] simplemachines [dot] org                       
Quote"Somewhere, something incredible is waiting to be known." - Carl Sagan

1Chope

 @ -[n3rve]
Yeah you are correct .thanks but I can see the nairaland Robots.txt is a bit different

here is is

User-agent:*
Disallow:/forum
Disallow:/?
Disallow:/index.php
Disallow:/nigeria?

User-agent:Mediapartners-Google
Disallow:

User-Agent:MSIECrawler
Disallow:/

User-Agent:Googlebot-Image
Disallow: /img/Mendie


Am a bit confused,can you take a look @ it?

N3RVE

Hello Wanchope,

User-agent:Mediapartners-Google
The mediapartners-google bot (which is the one used for AdSense, not the indexing robot) is banned from accessing the list of directories. However, the rule applies only to that particular bot.
If you want to exclude all bots from that list of directories, then you simply need:

User-agent: *
Disallow: /cgi-bin/


User-Agent:Googlebot-Image
This denies access to Googlebot-image to any files in your domain.

-[n3rve]
Ralph "[n3rve]" Otowo
Former Marketing Co-ordinator, Simple Machines.
ralph [at] simplemachines [dot] org                       
Quote"Somewhere, something incredible is waiting to be known." - Carl Sagan

Advertisement: