Redirection : force index.php in URL

Discussions about Apache mod Rewrite, .htaccess, Use, experiences ... URL Rewriting.

Moderator: Moderators

Redirection : force index.php in URL

Postby JanoF » Tue Jul 18, 2006 8:42 am

Greet,
what mod_rewrite it is necessary then that oneself near taken http://www.example.tld redirection on http://www.example.tld/index.php ?
Have this here too you, http://phpbb-seo.com ---> http://www.phpbb-seo.com/index.php
How then? thx
User avatar
JanoF
 
Posts: 43
Joined: Tue May 30, 2006 4:01 pm

Advertisement

Postby dcz » Tue Jul 18, 2006 9:03 am

hello janof ;)

Yes, this rewriteruel is the easy way to get rid of the index.php duplicate.

This will off course be part of the Zero dupe, but here is the trick :

Code: Select all
RewriteRule ^phpbb/$ /phpbb/index.php [QSA,L,R=301]


Tu put right after the www prefix rewriterule or just before the forum protection rule in case you don't use the www one.


Then under certain circumstances, you may have to use this one instead :

Code: Select all
RewriteRule ^phpbb/$ http://www.example.com/phpbb/index.php [QSA,L,R=301]


Just if you have a default domain set on the server for this Vhost and is different from the one used for phpBB (this happen ;) )

Of course, make sure to change example.com and phpbb/ with the relevant info ;)

++
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: 21238
Joined: Fri Apr 28, 2006 9:03 pm

Postby JanoF » Tue Jul 18, 2006 9:20 am

thx, works.... :)
User avatar
JanoF
 
Posts: 43
Joined: Tue May 30, 2006 4:01 pm

Postby dcz » Tue Jul 18, 2006 9:33 am

you're welcome :D
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: 21238
Joined: Fri Apr 28, 2006 9:03 pm

Postby AmirAbbas » Sat Sep 09, 2006 7:33 am

hello

i tried this trick but it doesnt work for me

my forum is installed in -http://forum.persia-cms.com

i have this part of rewrite rules in my forum .htaccess file

Code: Select all
Options +FollowSymlinks

RewriteEngine On

RewriteBase /

RewriteCond %{HTTP_HOST} !^forum\.persia-cms\.com$ [NC]
RewriteRule ^(.*) http://forum.persia-cms.com/$1 [QSA,L,R=301]
RewriteRule ^forum.persia-cms.com/$ forum.persia-cms.com/index.php [QSA,L,R=301]


but this code doesn't work
User avatar
AmirAbbas
phpBB SEO Team
phpBB SEO Team
 
Posts: 534
Joined: Thu May 11, 2006 3:30 pm
Location: IRAN

Postby dcz » Sat Sep 09, 2006 3:36 pm

I think you need to try :
Code: Select all
Options +FollowSymlinks

RewriteEngine On

RewriteBase /

RewriteCond %{HTTP_HOST} !^forum\.persia-cms\.com$ [NC]
RewriteRule ^(.*) http://forum.persia-cms.com/$1 [QSA,L,R=301]
RewriteRule ^$ /index.php [QSA,L,R=301]


instead, and eventually :

Code: Select all
Options +FollowSymlinks

RewriteEngine On

RewriteBase /

RewriteCond %{HTTP_HOST} !^forum\.persia-cms\.com$ [NC]
RewriteRule ^(.*) http://forum.persia-cms.com/$1 [QSA,L,R=301]
RewriteRule ^$ http://forum.persia-cms.com/index.php [QSA,L,R=301]


if not enough.

++
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: 21238
Joined: Fri Apr 28, 2006 9:03 pm

Postby AmirAbbas » Sun Sep 10, 2006 4:41 am

thanks

the first one works :D
User avatar
AmirAbbas
phpBB SEO Team
phpBB SEO Team
 
Posts: 534
Joined: Thu May 11, 2006 3:30 pm
Location: IRAN

Postby AmirAbbas » Sun Sep 10, 2006 4:42 am

thanks

the first one worked for me :D

Code: Select all
RewriteRule ^$ /index.php [QSA,L,R=301]
User avatar
AmirAbbas
phpBB SEO Team
phpBB SEO Team
 
Posts: 534
Joined: Thu May 11, 2006 3:30 pm
Location: IRAN

Postby dcz » Sun Sep 10, 2006 10:33 am

;)
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: 21238
Joined: Fri Apr 28, 2006 9:03 pm

Postby AmirAbbas » Fri Oct 27, 2006 1:19 pm

excuse me

can i ask how can i remove index.php forum first page url ? :wink:
User avatar
AmirAbbas
phpBB SEO Team
phpBB SEO Team
 
Posts: 534
Joined: Thu May 11, 2006 3:30 pm
Location: IRAN

Postby Peter77 » Fri Oct 27, 2006 4:51 pm

Interesting. :)
Last edited by Peter77 on Sat Oct 28, 2006 6:29 pm, edited 2 times in total.
Peter77
phpBB SEO Team
phpBB SEO Team
 
Posts: 524
Joined: Wed May 10, 2006 9:46 am
Location: Michigan

Postby dcz » Fri Oct 27, 2006 5:41 pm

I'll do this in the mod rewrite update, because you as well need to change the way links are outputted on your forum.

It's no big deal, could be a good occasion to start a new thread if you do not want to wait :roll:

++
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: 21238
Joined: Fri Apr 28, 2006 9:03 pm

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

Postby AmirAbbas » Sat Oct 28, 2006 1:55 pm

hi

i ask this questiuon in this topic and you said to me to make a new topic for it

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

thanks :)
User avatar
AmirAbbas
phpBB SEO Team
phpBB SEO Team
 
Posts: 534
Joined: Thu May 11, 2006 3:30 pm
Location: IRAN

Postby dcz » Sun Oct 29, 2006 3:05 pm

Well, this was because this topic is dedicated to forcing the index.php in URL, so I though it could be a good thing to lunch a new one to talk about doing the opposite .

++
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: 21238
Joined: Fri Apr 28, 2006 9:03 pm

Postby AmirAbbas » Sun Oct 29, 2006 3:14 pm

OH

excuse me
i thought that i made a new post
unfortunately i wanted to make a new post but i clicked on reply button

i will made a new topic :oops:
User avatar
AmirAbbas
phpBB SEO Team
phpBB SEO Team
 
Posts: 534
Joined: Thu May 11, 2006 3:30 pm
Location: IRAN

Next

Return to Apache mod Rewrite

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 4 guests