phpBB SEO
Boards
Directory  
SEO  
Downloads
  phpBB SEO : Search Engine Optimization, Directory, Forums  
Index
Forums
Annuaire
Référencement
Télécharger
 
  Search Rechercher
    Register
Username :  Password :  Log me on automatically each visit  
S'enregistrer  
 
   
Locking the www in urls
Goto page Previous  1, 2, 3, 4, 5, 6, 7  Next
 
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » SEO Techniques
::  
Author Message
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 13354

Locking the www in urlsPosted: Fri Sep 08, 2006 7:38 am    Post subject: Re: Locking the www in urls

amir abbas wrote:
hello

my domain is on new server
both

http://persia-cms.com
and
http://www.persia-cms.com

works for my domain
how can i lock www in my first domain and all subdomain
i have subdomain in this address

http://forum.persia-cms.com

Confused


Very simple, if as I think the forum sub-domain is located in a separate folder (can be inside though) than the main domain's root.

If so, you'll just need to use the suggested rewriterules, the negative one :

Code:
RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
RewriteRule ^(.*) http://www.example.com/$1 [QSA,L,R=301]


to you main domain's .htaccess.

This will make sure http://www.persia-cms.com is the only used domain for the main one.

Then, for your sub-domain's .htaccess, same thing as www.forum.persia-cms.com and forum.persia-cms.com are working, you have top choose one of the two and lock it.

Something like :
Code:
RewriteCond %{HTTP_HOST} !^www\.forum\.example\.com$ [NC]
RewriteRule ^(.*) http://www.forum.example.com/$1 [QSA,L,R=301]


to keep www prefix or :

Code:
[code]RewriteCond %{HTTP_HOST} !^forum\.example\.com$ [NC]
RewriteRule ^(.*) http://forum.example.com/$1 [QSA,L,R=301][/code]


To get rid of it.

Wink


++

_________________
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
Visit poster's website
AmirAbbas
phpBB SEO Team
phpBB SEO Team


Joined: 11 May 2006
Posts: 529
Location: IRAN

Locking the www in urlsPosted: Fri Sep 08, 2006 7:58 am    Post subject: Re: Locking the www in urls

Very Happy

thanks

i add this one to my root .htaacess file

Code:

Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.persia-cms\.com$ [NC]
RewriteRule ^(.*) http://www.persia-cms.com/$1 [QSA,L,R=301]


and this one to my forum subdomain

Code:
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.forum\.persia-cms\.com$ [NC]
RewriteRule ^(.*) http://www.forum.persia-cms.com/$1 [QSA,L,R=301]


both of them working perfect Wink
but another question

a have near 850 link to my -http://forum.persia-cms.com
what will happen for this link ?

what can i do ?
i must change all of them ?!

and which one is better
having WWW for subdomain
or get rid of www for subdomain

_________________
طراحی وب ، آموزش سئو ، آموزش CSS ، phpbb فارسی ، phpbb3 فارسی ، دروپال فارسی
طراحی وب ، قالب وبلاگ ، استاندارد وب ، آموزش CSS و HTML ، آموزش php


Last edited by AmirAbbas on Fri Sep 08, 2006 8:34 am; edited 1 time in total
Back to top
Visit poster's website
lavinya
PR1
PR1


Joined: 24 Jul 2006
Posts: 159
Location: Turkey

Locking the www in urlsPosted: Fri Sep 08, 2006 8:13 am    Post subject: Re: Locking the www in urls

thanks for knowledges and reply... Very Happy ok.

dcz wrote:


There would be some more small optimizations doable in your .htaccess, we can look at it in the Apache mod rewrite forum if you like.

++


dcz if you my .htaccess make small optimizations I Will be very happy Smile

current my .htaccess ( http://www.lavinya.net/ .htaccess )
Code:
AddType application/x-httpd-php .html .htm

ErrorDocument 404 /404.html
ErrorDocument 403 /403.html

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.lavinya\.net$ [NC]
RewriteRule ^(.*) http://www.lavinya.net/$1 [QSA,L,R=301]

RewriteEngine On
RewriteRule ^phpBB2/post-([0-9]*)\.html phpBB2/viewtopic.php?p=$1 [QSA,L,NC]
RewriteRule ^phpBB2/view-poll([0-9]*)-([0-9]*)-([a-zA-Z]*).* phpBB2/viewtopic.php?t=$1&postdays=$2&postorder=$3&vote=viewresult [L,NC]
RewriteRule ^phpBB2/about([0-9]*).html&highlight=([a-zA-Z0-9]*) phpBB2/viewtopic.php?t=$1&highlight=$2 [L,NC]
RewriteRule ^phpBB2/about([0-9]*).html&view=newest phpBB2/viewtopic.php?t=$1&view=newest [L,NC]
RewriteRule ^phpBB2/about([0-9]*)-([0-9]*)-([a-zA-Z]*)-([0-9]*).* phpBB2/viewtopic.php?t=$1&postdays=$2&postorder=$3&start=$4 [L,NC]
RewriteRule ^phpBB2/about([0-9]*)-([0-9]*).* phpBB2/viewtopic.php?t=$1&start=$2 [L,NC]
RewriteRule ^phpBB2/about([0-9]*).* phpBB2/viewtopic.php?t=$1 [L,NC]
RewriteRule ^phpBB2/about([0-9]*).html phpBB2/viewtopic.php?t=$1&start=$2&postdays=$3&postorder=$4&highlight=$5 [L,NC]
RewriteRule ^phpBB2/mark-forum([0-9]*).html* phpBB2/viewforum.php?f=$1&mark=topics [L,NC]
RewriteRule ^phpBB2/updates-topic([0-9]*).html* phpBB2/viewtopic.php?t=$1&watch=topic [L,NC]
RewriteRule ^phpBB2/stop-updates-topic([0-9]*).html* phpBB2/viewtopic.php?t=$1&unwatch=topic [L,NC]
RewriteRule ^phpBB2/forum-([0-9]*).html phpBB2/viewforum.php?f=$1 [L,NC]
RewriteRule ^phpBB2/forum-([0-9]*).* phpBB2/viewforum.php?f=$1 [L,NC]
RewriteRule ^phpBB2/topic-([0-9]*)-([0-9]*)-([0-9]*).* phpBB2/viewforum.php?f=$1&topicdays=$2&start=$3 [L,NC]
RewriteRule ^phpBB2/ptopic([0-9]*).* phpBB2/viewtopic.php?t=$1&view=previous [L,NC]
RewriteRule ^phpBB2/ntopic([0-9]*).* phpBB2/viewtopic.php?t=$1&view=next [L,NC]
RewriteRule ^phpBB2/ara-([0-9]*)-([0-9]*).html phpBB2/search.php?search_id=$1&start=$2 [L]
RewriteRule ^phpBB2/arama-yazar-([a-zA-Z0-9_-]*).html phpBB2/search.php?&search_author=$1 [L]
RewriteRule ^phpBB2/cevapsiz.html phpBB2/search.php?search_id=$1 [L]
RewriteRule ^phpBB2/yeni-kayit.html phpBB2/profile.php?mode=register&agreed=true [L]
RewriteRule ^phpBB2/kayit-coppa.html phpBB2/profile.php?mode=register&agreed=true&coppa=true [L]
RewriteRule ^phpBB2/kayit.html phpBB2/profile.php?&mode=register [L]
RewriteRule ^phpBB2/bilgiduzenle.html phpBB2/profile.php?mode=editprofile [L]
RewriteRule ^phpBB2/uye-([0-9]*).html phpBB2/profile.php?mode=viewprofile&u=$1 [L]
RewriteRule ^phpBB2/kayipsifre.html phpBB2/profile.php?mode=sendpassword [L]
RewriteRule ^phpBB2/kategori-([0-9]*).html phpBB2/index.php\?c=$1 [L]
RewriteRule ^phpBB2/uyelistesi-([a-zA-Z0-9]*)-([a-zA-Z]*)-([0-9]*).html phpBB2/memberlist.php\?mode=$1&order=$2&start=$3 [L]
RewriteRule ^phpBB2/uyelistesi.html phpBB2/memberlist.php [L]
RewriteRule ^phpBB2/sss-([a-zA-Z0-9]*).html phpBB2/faq.php\?mode=$1 [L]
RewriteRule ^phpBB2/sss.html phpBB2/faq.php [L]
RewriteRule ^phpBB2/sitemaps.xml$ phpBB2/sitemap.php [L]
RewriteRule ^phpBB2/sitemap-forum-([0-9]+).xml$ phpBB2/sitemap.php?fid=$1 [L]
RewriteRule ^phpBB2/sitemap-forum.xml$ phpBB2/sitemap.php?forum [L]
RewriteRule ^galeri/lightbox\.htm$ galeri/lightbox.php?%{QUERY_STRING}
RewriteRule ^galeri/lightbox\.([0-9]+)\.htm$ galeri/lightbox.php?page=$1&%{QUERY_STRING}
RewriteRule ^galeri/search\.htm$ galeri/search.php?%{QUERY_STRING}
RewriteRule ^galeri/search\.([0-9]+)\.htm$ galeri/search.php?page=$1&%{QUERY_STRING}
RewriteRule ^galeri/cat\.htm$ galeri/categories.php?%{QUERY_STRING}
RewriteRule ^galeri/cat([0-9]+)\.([0-9]+)\.htm$ galeri/categories.php?cat_id=$1&page=$2&%{QUERY_STRING}
RewriteRule ^galeri/cat([0-9]+)\.htm$ galeri/categories.php?cat_id=$1&%{QUERY_STRING}
RewriteRule ^galeri/img([0-9]+)\.htm$ galeri/details.php?image_id=$1&%{QUERY_STRING}
RewriteRule ^galeri/img([0-9]+)\.([a-zA-Z0-9]+)\.htm$ galeri/details.php?image_id=$1&mode=$2&%{QUERY_STRING}
RewriteRule ^galeri/postcard([a-zA-Z0-9]+)\.htm$ galeri/postcards.php?postcard_id=$1&%{QUERY_STRING}
RewriteRule ^galeri/postcard\.img([0-9]+)\.htm$ galeri/postcards.php?image_id=$1&%{QUERY_STRING}
Back to top
Visit poster's website
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 13354

Locking the www in urlsPosted: Fri Sep 08, 2006 8:57 am    Post subject: Re: Locking the www in urls

dcz wrote:


There would be some more small optimizations doable in your .htaccess, we can look at it in the Apache mod rewrite forum if you like.

++


Let's avoid off topic, I forgot to mention the link : Apache mod rewrite forum

Wink

_________________
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
Visit poster's website
lavinya
PR1
PR1


Joined: 24 Jul 2006
Posts: 159
Location: Turkey

Locking the www in urlsPosted: Fri Sep 08, 2006 8:58 am    Post subject: Re: Locking the www in urls

ok dcz thanks. Smile
Back to top
Visit poster's website
lavinya
PR1
PR1


Joined: 24 Jul 2006
Posts: 159
Location: Turkey

Locking the www in urlsPosted: Sat Sep 09, 2006 8:24 am    Post subject: Re: Locking the www in urls

dcz I have big problem Sad

my problem is this system is showing doesnt lacking pages.

for example: there is no addresses like www. lavinya.net/phpbb2/about1594.html
or about159SDFSD4.html etc.... ...

but it is showing Sad

my file is "phpBB2" (not bb, it must be BB)

and not exiting subdomain (eg dcz. lavinya.org) but redirect to main page ?
but it must not show.
this is spam I think.

Crying or Very sad

please help me Sad
Back to top
Visit poster's website
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 13354

Locking the www in urlsPosted: Sat Sep 09, 2006 3:29 pm    Post subject: Re: Locking the www in urls

lavinya wrote:
dcz I have big problem Sad

my problem is this system is showing doesn't lacking pages.

for example: there is no addresses like -www.lavinya.net/phpbb2/about1594.html


Well this could be fixed with something like :
Code:
RewriteRule  ^phpbb2/(.*) /phpBB2/$1 [R=301,L]

Just after the www rewriterule.
You may need to get rid of the L flag : [R=301,L] => [R=301]

lavinya wrote:

or about159SDFSD4.html etc.... ...


This is due to the able2know rewriterules, they are not strict enough and accept characters and digits where they should only accept digits.
Then, some intval(159SDFSD4) must end up being an integer, with luck being a real topic id.

This is just impossible with the phpBB SEO rewriterules, and is a duplicate source, especially if you run Google AdSense, as Google is as well grabbing URLs to spider from there, so the link only need to be used once to exist for Google.

lavinya wrote:

this is spam I think.


This is very possible someone started posting links like this, but could as well only be a user testing you mod rewrite and the Google AdSense to have grabbed it.

lavinya wrote:

and not exiting subdomain (eg dcz. lavinya.org) but redirect to main page ?


I am sorry I am to unsure about what you're saying here to answer. Could you elaborate a bit on this ?

++

_________________
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
Visit poster's website
AmirAbbas
phpBB SEO Team
phpBB SEO Team


Joined: 11 May 2006
Posts: 529
Location: IRAN

Locking the www in urlsPosted: Fri Nov 03, 2006 5:15 am    Post subject: Re: Locking the www in urls

hi again

i learnt how can i lock www in subdomain
i want to lock www in this URL

-http://aerospacetalk.com/forum/

how can i do it ?
thanks in advance Wink

_________________
طراحی وب ، آموزش سئو ، آموزش CSS ، phpbb فارسی ، phpbb3 فارسی ، دروپال فارسی
طراحی وب ، قالب وبلاگ ، استاندارد وب ، آموزش CSS و HTML ، آموزش php
Back to top
Visit poster's website
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 13354

Locking the www in urlsPosted: Fri Nov 03, 2006 11:06 am    Post subject: Re: Locking the www in urls

Well, it should be rather straighforward, something like :

Code:
RewriteCond %{HTTP_HOST} !^www\.aerospacetalk\.com$ [NC]
RewriteRule ^(.*) http://www.aerospacetalk.com/$1 [QSA,L,R=301]


in the domain's root (eg one level above forum/)

With off course the same small turnarounds as always, you may need to play a bit with syntax before it will fully work.


++

_________________
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
Visit poster's website
AmirAbbas
phpBB SEO Team
phpBB SEO Team


Joined: 11 May 2006
Posts: 529
Location: IRAN

Locking the www in urlsPosted: Fri Nov 03, 2006 1:10 pm    Post subject: Re: Locking the www in urls

its not clear for me
now the www is fixed in main domain
i mean -http://aerospacetalk.com will redirect to -http://www.aerospacetalk.com

i have problem with -http://aerospacetalk.com/forum/

_________________
طراحی وب ، آموزش سئو ، آموزش CSS ، phpbb فارسی ، phpbb3 فارسی ، دروپال فارسی
طراحی وب ، قالب وبلاگ ، استاندارد وب ، آموزش CSS و HTML ، آموزش php
Back to top
Visit poster's website
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 13354

Locking the www in urlsPosted: Sat Nov 04, 2006 8:39 am    Post subject: Re: Locking the www in urls

Do you have more than one .htaccess with rewriterules ?

The principle would be here to only use one at the root level. Please post your .htaccess in case you have troubles Wink

++

_________________
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
Visit poster's website
AmirAbbas
phpBB SEO Team
phpBB SEO Team


Joined: 11 May 2006
Posts: 529
Location: IRAN

Locking the www in urlsPosted: Mon Nov 06, 2006 3:45 am    Post subject: Re: Locking the www in urls

dcz wrote:
Do you have more than one .htaccess with rewriterules ?


you're right Mr. Green

i had two .htaccess file Smile
i removed one of them

_________________
طراحی وب ، آموزش سئو ، آموزش CSS ، phpbb فارسی ، phpbb3 فارسی ، دروپال فارسی
طراحی وب ، قالب وبلاگ ، استاندارد وب ، آموزش CSS و HTML ، آموزش php
Back to top
Visit poster's website
AmirAbbas
phpBB SEO Team
phpBB SEO Team


Joined: 11 May 2006
Posts: 529
Location: IRAN

Locking the www in urlsPosted: Wed Dec 13, 2006 4:43 pm    Post subject: Re: Locking the www in urls

one of my friend asked me " how can i lock www in url in windows IIS server ?"

is it possible ? Rolling Eyes

_________________
طراحی وب ، آموزش سئو ، آموزش CSS ، phpbb فارسی ، phpbb3 فارسی ، دروپال فارسی
طراحی وب ، قالب وبلاگ ، استاندارد وب ، آموزش CSS و HTML ، آموزش php
Back to top
Visit poster's website
AmirAbbas
phpBB SEO Team
phpBB SEO Team


Joined: 11 May 2006
Posts: 529
Location: IRAN

Locking the www in urlsPosted: Thu Dec 14, 2006 12:57 pm    Post subject: Re: Locking the www in urls

bump Very Happy

_________________
طراحی وب ، آموزش سئو ، آموزش CSS ، phpbb فارسی ، phpbb3 فارسی ، دروپال فارسی
طراحی وب ، قالب وبلاگ ، استاندارد وب ، آموزش CSS و HTML ، آموزش php
Back to top
Visit poster's website
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 13354

Locking the www in urlsPosted: Thu Dec 14, 2006 1:09 pm    Post subject: Re: Locking the www in urls

bimp Very Happy

Well, I am currently working on it with a french phpBB SEO member. We are looking for a php solution.

It should be doable using isapi_rewrite, I'll see how, but I do not have any IIS installation to work with so ...

++

_________________
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
Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » SEO Techniques
Page 4 of 7 Goto page Previous  1, 2, 3, 4, 5, 6, 7  Next

Navigation Similar Topics

Jump to: