how can i remove index.php from first page URL ?

Discussions about the phpBB2 Forum. How to get the best from this powerful script.

Moderator: Moderators

Postby dcz » Sun Nov 05, 2006 12:24 pm

Very possible, would be a nice occasion to start a new topic ;)

http://www.phpbb-seo.com/index.php ;)

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21391
Joined: Fri Apr 28, 2006 9:03 pm

Advertisement

Postby AmirAbbas » Mon Nov 06, 2006 7:33 am

dcz wrote:You could both try to hard code PHPBB_URL in the seo_redirect(PHPBB_URL); call :

Code: Select all
seo_redirect("http://www.example.com/phpBB/");


Just in case ;)


its little strange

when forum is installed in subdomain, there isn't any problem
but when your forum is installed in a folder and its part of main domain
the forum index link guide users to first page of main domain instead of first page of forum :shock:
User avatar
AmirAbbas
phpBB SEO Team
phpBB SEO Team
 
Posts: 534
Joined: Thu May 11, 2006 3:30 pm
Location: IRAN

Postby dcz » Mon Nov 06, 2006 8:44 am

Well, this is rather strange because :

http://www.phpbb-seo.com/boards/index.php and http://www.phpbb-seo.com/forums/index.php

Can you send us the beginning of your index.php file (up to the la seo_redirect call ) so I can check ?

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21391
Joined: Fri Apr 28, 2006 9:03 pm

Postby AmirAbbas » Mon Nov 06, 2006 12:18 pm

ok

Code: Select all
<?php
/***************************************************************************
*                                index.php
*                            -------------------
*   begin                : Saturday, Feb 13, 2001
*   copyright            : (C) 2001 The phpBB Group
*   email                : support@phpbb.com
*
*   $Id: index.php,v 1.99.2.7 2006/01/28 11:13:39 acydburn Exp $
*
*
***************************************************************************/

/***************************************************************************
*
*   This program is free software; you can redistribute it and/or modify
*   it under the terms of the GNU General Public License as published by
*   the Free Software Foundation; either version 2 of the License, or
*   (at your option) any later version.
*
***************************************************************************/

define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//

$viewcat = ( !empty($HTTP_GET_VARS[POST_CAT_URL]) ) ? $HTTP_GET_VARS[POST_CAT_URL] : -1;

if( isset($HTTP_GET_VARS['mark']) || isset($HTTP_POST_VARS['mark']) )
{
   $mark_read = ( isset($HTTP_POST_VARS['mark']) ) ? $HTTP_POST_VARS['mark'] : $HTTP_GET_VARS['mark'];
}
else
{
   $mark_read = '';
}
// 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
User avatar
AmirAbbas
phpBB SEO Team
phpBB SEO Team
 
Posts: 534
Joined: Thu May 11, 2006 3:30 pm
Location: IRAN

Postby dcz » Mon Nov 06, 2006 1:37 pm

mmh, nothing wrong in here, assuming PHPBB_URL is correct, the only other place where something could happen is in your .htaccess.

Could you post it here ?

You confirm that with the hard coding of the correct URL (seo_redirect("http://www.example.com/phpBB/");) it's doing the same ?

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21391
Joined: Fri Apr 28, 2006 9:03 pm

Postby dcz » Mon Nov 06, 2006 6:37 pm

Oups, noticed a typo, missing "Status:" in the header lol.

Code: Select all
header("Status: 301 Moved Permanently", FALSE, 301);


So post fixed ;)

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21391
Joined: Fri Apr 28, 2006 9:03 pm

Postby nims » Sat Nov 18, 2006 10:39 am

I guess there is some problem when the forum is in a subdirectory like my forum is in forum directory and when I change page_header file the link to Forum Index points to website's home page. It shud point to forums homepage. :?:
Hire Seo Staff overseas and Website designing and development in India for best results at affordable prices.
nims
PR2
PR2
 
Posts: 245
Joined: Wed Oct 11, 2006 9:31 am
Location: New Delhi, India

Postby Peter77 » Sat Nov 18, 2006 7:14 pm

dcz wrote:Oups, noticed a typo, missing "Status:" in the header lol.

Code: Select all
header("Status: 301 Moved Permanently", FALSE, 301);


So post fixed ;)

++


Hey dcz, which post are you talking about. and are you informing amir abbas or everyone?

Thanks
Peter77
phpBB SEO Team
phpBB SEO Team
 
Posts: 532
Joined: Wed May 10, 2006 9:46 am

Postby dcz » Sun Nov 19, 2006 5:22 pm

@nims

Strange, the link should be relative as it is at first.

Did you have the same code to search for in the file ?

Anyway, you can fix this easily by just hard coding you phpBB URL in page_header.php.

Find :

Code: Select all
'U_INDEX' => append_sid('/'),


replace with :

Code: Select all
'U_INDEX' => append_sid('http://www.example.com/phpBB/'),


Withe the correct URL of course ;)

Peter77

I was informing everyone, and edited my posts, but this is rather an on /off error, so if it's working, it should not apply to your case.

You can check the changed file to make sure you have the correct syntax if you want to be sure.

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21391
Joined: Fri Apr 28, 2006 9:03 pm

Postby nims » Mon Nov 20, 2006 5:07 am

I think you shud check this issue bcos everyone seems to be facing this problem. Hardcoded option is something I wud say a temporary solution.
Hire Seo Staff overseas and Website designing and development in India for best results at affordable prices.
nims
PR2
PR2
 
Posts: 245
Joined: Wed Oct 11, 2006 9:31 am
Location: New Delhi, India

Postby dcz » Mon Nov 20, 2006 7:24 am

Yes, I know, but as you can see the code change is obvious, so it rather looks like a specific setting issue if it does not lead to the proper page.

I don't see anything wrong on your forum, beside the final touch was taken off it seems.

And actually, providing here, the full URL is better SEO wise than to leave the relative path as is.

You could if not already done, define a constant in common.php :

Code: Select all
define('PHPBB_URL', 'http://www.example.com/phpBB/');


and use it after like this :

Code: Select all
'U_INDEX' => append_sid(PHPBB_URL),


with these code changes.

This constant is handy will be used by many modules here, so it can be a good thing already.

You could as well try to just replace the line to search for in page_header.php with :

Code: Select all
'U_INDEX' => append_sid(),


And see if this is enough to have the relative path working.

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21391
Joined: Fri Apr 28, 2006 9:03 pm

Postby nims » Tue Nov 21, 2006 5:25 am

Final touch given, messed up with some files as hard disk crashed.

OK its working fine now with
Code: Select all
'U_INDEX' => append_sid(PHPBB_URL),

in page_header.php
Thanks :)
Hire Seo Staff overseas and Website designing and development in India for best results at affordable prices.
nims
PR2
PR2
 
Posts: 245
Joined: Wed Oct 11, 2006 9:31 am
Location: New Delhi, India

Postby AmirAbbas » Wed Nov 22, 2006 7:27 am

oops :shock:

i forgot that i have this topic

thanks dcz this one solved the problem
User avatar
AmirAbbas
phpBB SEO Team
phpBB SEO Team
 
Posts: 534
Joined: Thu May 11, 2006 3:30 pm
Location: IRAN

Postby lavinya » Sun Jan 07, 2007 7:23 pm

hello all.

I install this mod. http://www.phpbb-seo.com/boards/phpbb-f ... .html#2621
ok works.

But click ../phpBB2/index.php
Fatal error: Call to undefined function: seo_redirect() in /.../httpdocs/phpBB2/index.php on line 50

how to fix?

thanks.
User avatar
lavinya
PR1
PR1
 
Posts: 167
Joined: Mon Jul 24, 2006 9:05 am
Location: Turkey

Postby dcz » Sun Jan 07, 2007 10:42 pm

well you just need to read the third post ;)

http://www.phpbb-seo.com/boards/phpbb-f ... .html#2649

Code: Select all
// 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
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21391
Joined: Fri Apr 28, 2006 9:03 pm

PreviousNext

Return to phpBB2 Forum

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 3 guests