View Full Version : Please is there a way to redirect /index.php to forum homepage?
Snowball1
09-03-2009, 02:25 PM
I am just wondering if there is a way I can redirect forums.mywebsite.com/index.php to forums.mywebsite.com without the index.php. My forum is such a way that when you type forums.mywebsite.com, it doesn't redirect to forums.mywebsite.com/index.php and when you type forums.mywebsite.com/index.php, it doesn't redirect to forums.mywebsite.com hence I am getting two separate pages with duplicate contents. forums.mywebsite.com has google pagerank but forums.mywebsite.com/index.php has no google pagerank so I will like to redirect forums.mywebsite.com/index.php to forums.mywebsite.com. I will appreciate it if you can help me in simple terms because i know very little about coding. Thanks very much for your support.
Lynne
09-03-2009, 02:28 PM
Usually, if you put forums.yoursite.com in your browser url, you are automatically directed to forums.yoursite.com/index.php . What are you being directed to? Do you have an index.html page? If so, you may want to remove it and see if that fixes the problem.
Snowball1
09-03-2009, 02:35 PM
in my case the forums.example.com/ doesn't redirect to forums.example.com/index.php and vice versa. they are two separate pages with the same content. I will like to redirect the forums.example.com/index.php to forums.example.com because the forums.example.com/index.php has no pagerank while forums.example.com has. Thanks very much
karim004
09-03-2009, 02:39 PM
Redirect the index.php Using a 301 Redirect !
1. if you dont have a .htaccess file, open notepad, name and save
the file as .htaccess (there is no extension).
2. If you already have a .htaccess file on your server,
download it to your desktop for editing.
3. Place this code in your .htaccess file:
Options +FollowSymLinks
RewriteEngine on
# index.php to /
RewriteCond %{THE_REQUEST} ^[A-Z]{3, 9}\ /.*index\.php\ HTTP/
RewriteRule ^(.*)index\.php$ /$1 [R=301,L]
5. Save the .htaccess file
6. Upload this file to the forum folder
Snowball1
09-21-2009, 02:02 PM
I tried the code Karim gave but it doesn't work. I keep on getting internal error.
Please Anymore suggestions? :)
Lynne
09-21-2009, 02:52 PM
Google? There are lots of sites on the use of htaccess to redirect pages.
Snowball1
10-22-2009, 10:53 PM
I searched on google but I couldn't get what I'm looking for. I will be very happy if someone can help me.
SocialNetworkBuzz
10-22-2009, 11:02 PM
in my case the forums.example.com/ doesn't redirect to forums.example.com/index.php and vice versa. they are two separate pages with the same content. I will like to redirect the forums.example.com/index.php to forums.example.com because the forums.example.com/index.php has no pagerank while forums.example.com has. Thanks very much
That is because when a browser connects to a site it first looks for index.html then index.htm and then index.php. Reason your seeing your index.php content going to just forums.example.com is because it is still displaying the index file, it just doesn't auto add it to the url. Try a test, change your index to test.php then go to forums.example.com You won't get the index content, you'll get a directory tree listing.. why? because you don't have a index file now.
Because index is your default is also why index.php has no ranking but forums.example.com does.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.