| :: |
| Author |
Message |
Peter77 phpBB SEO Team


Joined: 10 May 2006 Posts: 512 Location: Michigan
|
Posted: Thu Nov 02, 2006 4:34 am Post subject: Re: how can i remove index.php from first page URL ? |
|
|
| dcz wrote: |
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
++ |
This is a great idea! but at the moment I am getting an 404 if I type in my forums URL with index.php. and yes I did change example/phpBB with my own URL. |
|
|
| Back to top |
|
 |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 14279
|
|
| 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: 14279
|
|
| Back to top |
|
 |
AmirAbbas phpBB SEO Team


Joined: 11 May 2006 Posts: 529 Location: IRAN
|
|
| Back to top |
|
 |
AmirAbbas phpBB SEO Team


Joined: 11 May 2006 Posts: 529 Location: IRAN
|
Posted: Fri Nov 03, 2006 5:18 am Post subject: Re: how can i remove index.php from first page URL ? |
|
|
| dcz wrote: | 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
++ |
i tried this one for aerospacetalk.com/forum/
but i don't know why the index page referred to main domain
when you click on forum index link you will go to aerospacetalk.com/ instead of aerospacetalk.com/forum/
note: a have installed zero dupe on that forum |
_________________ چهار گوش - طراحی وب - مجله طراحی وب |
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 14279
|
|
| Back to top |
|
 |
AmirAbbas phpBB SEO Team


Joined: 11 May 2006 Posts: 529 Location: IRAN
|
Posted: Fri Nov 03, 2006 1:11 pm Post subject: Re: how can i remove index.php from first page URL ? |
|
|
| dcz wrote: | It must be PHPBB_URL to be wrong in common.php.
PHPBB_URL should be defined as the full phpBB URL eg www.example.com/phpBB/.
++ |
im sure that part is correct  |
_________________ چهار گوش - طراحی وب - مجله طراحی وب |
|
| Back to top |
|
 |
Peter77 phpBB SEO Team


Joined: 10 May 2006 Posts: 512 Location: Michigan
|
Posted: Sat Nov 04, 2006 6:27 am Post subject: Re: how can i remove index.php from first page URL ? |
|
|
| dcz wrote: | What about the zero duplicate version of this mod (the first one) ?
Don't you have it running ? |
Yup, I have the zero duplicate installed. also I noticed that the forum's login.php page submitted an 404 when logging out. I suppose I can start a new thread on this if you are up for the Juarol challange.  |
_________________ Juarol.com
| Frekuenciadigital.com | |
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 14279
|
|
| Back to top |
|
 |
Peter77 phpBB SEO Team


Joined: 10 May 2006 Posts: 512 Location: Michigan
|
Posted: Sat Nov 04, 2006 10:44 am Post subject: Re: how can i remove index.php from first page URL ? |
|
|
Oops, just to be more clear. I meant this part:
| 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 |
Returns a 404 If I try entering though mysite.com/phpbb/index.php but not mysite.com/phpbb/
the original one does work. But I am intrested in that 301 redirect.  |
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 14279
|
|
| Back to top |
|
 |
Peter77 phpBB SEO Team


Joined: 10 May 2006 Posts: 512 Location: Michigan
|
Posted: Sat Nov 04, 2006 9:27 pm Post subject: Re: how can i remove index.php from first page URL ? |
|
|
Ok, sorry. I switched back to the original code becaue of the 404. but I have added 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.juarol.com/sucasa/");
exit();
}
// www.phpBB-SEO.com SEO TOOLKIT END |
to my index.php so you can see..
It seems to give an 404 and also when logging out from the forum.
:edit:
Ok, Fire Fox let's me see something that IE does not. it is not an 404, it is actually a 500
Moved Permanently
The document has moved here. ( links back to sucasa/index.php )
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
And the login.php is fine. its when logging out of the forum one gets redirected back to the forums/index.php. |
_________________ Juarol.com
| Frekuenciadigital.com | |
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 14279
|
|
| Back to top |
|
 |
Peter77 phpBB SEO Team


Joined: 10 May 2006 Posts: 512 Location: Michigan
|
Posted: Sun Nov 05, 2006 12:19 pm Post subject: Re: how can i remove index.php from first page URL ? |
|
|
oops, okay.
Could this method be applied to mxbb's index.php also? |
_________________ Juarol.com
| Frekuenciadigital.com | |
|
| Back to top |
|
 |
|
|