| :: |
| Author |
Message |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 13354
|
Posted: Fri Sep 08, 2006 7:38 am Post subject: Re: Locking the www in urls |
|
|
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.
++ |
_________________ 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
|
Posted: Fri Sep 08, 2006 7:58 am Post subject: Re: Locking the www in urls |
|
|
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
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 |
|
 |
lavinya PR1


Joined: 24 Jul 2006 Posts: 159 Location: Turkey
|
Posted: Fri Sep 08, 2006 8:13 am Post subject: Re: Locking the www in urls |
|
|
thanks for knowledges and reply... 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
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 |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 13354
|
|
| Back to top |
|
 |
lavinya PR1


Joined: 24 Jul 2006 Posts: 159 Location: Turkey
|
Posted: Fri Sep 08, 2006 8:58 am Post subject: Re: Locking the www in urls |
|
|
ok dcz thanks.  |
|
|
| Back to top |
|
 |
lavinya PR1


Joined: 24 Jul 2006 Posts: 159 Location: Turkey
|
Posted: Sat Sep 09, 2006 8:24 am Post subject: Re: Locking the www in urls |
|
|
dcz I have big problem
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
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.
please help me  |
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 13354
|
Posted: Sat Sep 09, 2006 3:29 pm Post subject: Re: Locking the www in urls |
|
|
| lavinya wrote: | dcz I have big problem
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 |
|
 |
AmirAbbas phpBB SEO Team


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

Joined: 28 Apr 2006 Posts: 13354
|
|
| 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: 13354
|
|
| 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
|
|
| 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: 13354
|
|
| Back to top |
|
 |
|
|