| :: |
| Author |
Message |
AmirAbbas phpBB SEO Team


Joined: 11 May 2006 Posts: 529 Location: IRAN
|
|
| Back to top |
|
 |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 13994
|
Posted: Sun Oct 29, 2006 3:50 pm Post subject: Re: how can i remove index.php from first page URL ? |
|
|
So, first you want to change the way links are outputted on your forum :
Open
| Code: | | includes/page_header.php |
Find :
| Code: | | 'U_INDEX' => append_sid('index.'.$phpEx), |
Replace with :
Then, we want to http 301 redirect www.example.com/phpBB/index.php to www.example.com/phpBB/ :
Open :
Find :
| Code: | else
{
$mark_read = '';
} |
After add :
| Code: | // www.phpBB-SEO.com SEO TOOLKIT BEGIN
$uri = $_SERVER['REQUEST_URI'];
If ($mark_read == '' && $viewcat == -1 && strpos($uri, "index.$phpEx")) {
seo_redirect(PHPBB_URL);
}
// www.phpBB-SEO.com SEO TOOLKIT END |
Note that I wrote this one using the function seo_redirect() and the PHPBB_URL constant, both defined in the zero dupe I just PMed you, so you'll need to install it before.
And you won't need to add :
| Code: |
$uri = $_SERVER['REQUEST_URI'];
|
Twice in index.php, the first one added here will be enough
++ |
_________________ Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________
Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche |
|
| Back to top |
|
 |
AmirAbbas phpBB SEO Team


Joined: 11 May 2006 Posts: 529 Location: IRAN
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 13994
|
Posted: Wed Nov 01, 2006 9:07 am Post subject: Re: how can i remove index.php from first page URL ? |
|
|
Good
What about the zero dupe, do you like it
It's as well because backlinks do not generally include index.php.
For phpBB index, www.example.com/ we get the external backlinks, and on www.example.com/index.php the internal.
With this you concentrate both internal and external backlinks on the same URL, it can only be better
By the way, for those without the Zero duplicate so far, here is what to do :
Add this :
| Code: |
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
$uri = $_SERVER['REQUEST_URI'];
If ($mark_read == '' && $viewcat == -1 && strpos($uri, "index.$phpEx")) {
header("Status: 301 Moved Permanently", FALSE, 301);
header("Location: http://www.example.com/phpBB/");
exit();
}
// www.phpBB-SEO.com SEO TOOLKIT END |
Where you replace http://www.example.com/phpBB/ by your forum's index url.
Instead of this :
| Code: | // www.phpBB-SEO.com SEO TOOLKIT BEGIN
$uri = $_SERVER['REQUEST_URI'];
If ($mark_read == '' && $viewcat == -1 && strpos($uri, "index.$phpEx")) {
seo_redirect(PHPBB_URL);
}
// www.phpBB-SEO.com SEO TOOLKIT END |
In the above code suggestion
++ |
_________________ Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________
Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche
Last edited by dcz on Mon Nov 06, 2006 6:37 pm; edited 2 times in total |
|
| Back to top |
|
 |
HB. PR0

Joined: 26 Oct 2006 Posts: 62
|
Posted: Wed Nov 01, 2006 1:37 pm Post subject: Re: how can i remove index.php from first page URL ? |
|
|
hey dcz, thanks for all your help thus far You asked that I continue over in this topic. Whenever you get a chance do you think you could help me with changing the index.php for CH boards? Thank you |
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 13994
|
Posted: Wed Nov 01, 2006 5:29 pm Post subject: Re: how can i remove index.php from first page URL ? |
|
|
So this means you do not find the above code in your index.php file ?
So for Categories hierarchy, you could try adding this :
| Code: | // www.phpBB-SEO.com SEO TOOLKIT BEGIN
$uri = $_SERVER['REQUEST_URI'];
If (substr($uri, -9, 9) == 'index.php') {
if ( !empty($db) ) {
$db->sql_close();
}
header("Status: 301 Moved Permanently", FALSE, 301);
header("Location: http://www.example.com/phpBB/");
exit();
}
// www.phpBB-SEO.com SEO TOOLKIT END |
Right before :
| Code: | | define('IN_PHPBB', true); |
Instead. |
_________________ Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________
Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche
Last edited by dcz on Mon Nov 06, 2006 6:38 pm; edited 2 times in total |
|
| Back to top |
|
 |
HB. PR0

Joined: 26 Oct 2006 Posts: 62
|
Posted: Wed Nov 01, 2006 5:31 pm Post subject: Re: how can i remove index.php from first page URL ? |
|
|
no this was not found in the index.php. I'll try what you just posted.
| Quote: | Code:
Index.php
Find :
Code:
else
{
$mark_read = '';
}
|
|
|
|
| Back to top |
|
 |
HB. PR0

Joined: 26 Oct 2006 Posts: 62
|
Posted: Wed Nov 01, 2006 5:38 pm Post subject: Re: how can i remove index.php from first page URL ? |
|
|
I tried your code, but it redirects back to my flash intro
edit: hold on about this. I forgot I had setup a redirect...let me try to remove it first to see what happens |
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 13994
|
|
| Back to top |
|
 |
HB. PR0

Joined: 26 Oct 2006 Posts: 62
|
Posted: Wed Nov 01, 2006 5:47 pm Post subject: Re: how can i remove index.php from first page URL ? |
|
|
I got rid of the flash intro (this is all on a test site) I also removed the redirect in my cPanel, and now I get a white page when attempting to view the index.
I'm not quite sure what you meant about not having index.php, the path is example.com/phpbb/index.php
I do have smartor's portal installed. I don't know if that makes a difference |
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 13994
|
Posted: Wed Nov 01, 2006 6:03 pm Post subject: Re: how can i remove index.php from first page URL ? |
|
|
What I mean is to do the same as here, try this link : http://www.phpbb-seo.com/boards/index.php
For the portal, yes, it does matter, but it depend if phpBB is installed in a sub folder or not.
As you can see www.phpbb-seo.com/index.php is as well taken care of, in a different folder.
If both portal and forum where in the same folder, you'd probably prefer to see portal.php loaded instead of index.php in such case.
And the same principle could be applied to portal.php, it's just on letter longer :
| Code: | | If (substr($uri, -9, 9) == 'index.php') |
would be replaced with
| Code: | | If (substr($uri, -10, 10) == 'portal.php') |
Then, sorry, I closed the db before we could even get connected to it lol, so delete :
| Code: | if ( !empty($db) ) {
$db->sql_close();
} |
In the suggested code.
++ |
_________________ Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________
Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche |
|
| Back to top |
|
 |
HB. PR0

Joined: 26 Oct 2006 Posts: 62
|
Posted: Wed Nov 01, 2006 6:11 pm Post subject: Re: how can i remove index.php from first page URL ? |
|
|
I think I might have confused you a little (or maybe even myself ) I just wanted to let you know I had a portal. I orginally had for example
www.example.com lead to the flash intro, but I deleted it now ( I meant to delete that long time ago). The flash intro lead to the portal, and from the portal of course you could go to the forum.
The portal.php and the forum's index.php is install on example.com/phpbb/
The portal loads just fine, but when I click the link to the forum from the portal, I get a blank white page. I hope this clears things up a little bit. |
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 13994
|
|
| Back to top |
|
 |
HB. PR0

Joined: 26 Oct 2006 Posts: 62
|
Posted: Wed Nov 01, 2006 6:58 pm Post subject: Re: how can i remove index.php from first page URL ? |
|
|
| wow, you are good. I did have a blank index.html file, but I just recently deleted it. I tried inserting that code in the .htaccess, but its still coming up blank. I don't want to waste too much of your time. If it remains showing example.com/phpbb/index.php will that have any negative results far as SEO goes? |
|
|
| Back to top |
|
 |
AmirAbbas phpBB SEO Team


Joined: 11 May 2006 Posts: 529 Location: IRAN
|
|
| Back to top |
|
 |
|
|