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


Joined: 10 May 2006 Posts: 512 Location: Michigan
|
Posted: Sun May 21, 2006 6:31 pm Post subject: Re: Locking the www in urls |
|
|
| dcz wrote: | | I am a bit confused here, because when I try to load you web site's url without the www, it works without adding the www. |
Hmm I did not pay attention to that... I guess the rewrite rules in my .htaccess are not working afterall...
| dcz wrote: |
Then, when I load your Google sitemap url, the output is not exactly the same as what I experience on other sites. The code is correct, but, the output is not shown the same way for the sitemapIndex than for the sitemaps.
have you changed something to the files ? Sorry, I did not opened the mx Google sitemap support thread, but if you experience further problems with this mod, just start a new thread, since this is about mod rewrite adaptation on it. |
I havn't touched the sitemap.php file or modified it in any way...
| dcz wrote: |
Then, you are not using the premodded files for phpBB SEO mod rewrite.
Re DL the pack and look in contrib/moded_4_mod_rewrites/phpBB_SEO_mod_Rewrites , your should use the phpBB advanced mod rewrite files instead of the regular one. This will change all your url from viewtopic.php?t=3381&start=15 to topic-title-vt3381-15.html, which are the only URL to consider in your case  |
are you talking about sitemap_forum.php? so I am supposed to use that and not sitemap.php? |
|
|
| Back to top |
|
 |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 13354
|
Posted: Mon May 22, 2006 9:28 am Post subject: Re: Locking the www in urls |
|
|
| Peter77 wrote: |
Hmm I did not pay attention to that... I guess the rewrite rules in my .htaccess are not working afterall...
|
Don't loose faith, it will work some how Again, how many .htaccess are you using and where ?
| Peter77 wrote: |
I havn't touched the sitemap.php file or modified it in any way...
|
Ok, it's no big deal, since the actual source code is ok.
| Peter77 wrote: |
are you talking about sitemap_forum.php? so I am supposed to use that and not sitemap.php? |
Nope, you should just overwrite the sitemap_forum.php file you are actually using with the one located in contrib/moded_4_mod_rewrites/phpBB_SEO_mod_Rewrites/Advanced_Mod_Rewrite
and you URLs will be outputted rewritten  |
_________________ 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 |
|
 |
Peter77 phpBB SEO Team


Joined: 10 May 2006 Posts: 512 Location: Michigan
|
Posted: Tue May 23, 2006 2:15 am Post subject: Re: Locking the www in urls |
|
|
| dcz wrote: | | Peter77 wrote: |
Hmm I did not pay attention to that... I guess the rewrite rules in my .htaccess are not working afterall...
|
Don't loose faith, it will work some how Again, how many .htaccess are you using and where ? |
I know, just gets frustrating sometimes. well I had a few .htaccess in some of my mxbb modules includes folders. I only had "Deny all" in it though. I did this cause some script kiddie installed a directory in my root folder some weeks ago. not that its gonna stop them, but thought it might help. well anyway, I took them all out now. so currently there are no .htaccess files besides my root folder.
| dcz wrote: |
| Peter77 wrote: |
I havn't touched the sitemap.php file or modified it in any way...
|
Ok, it's no big deal, since the actual source code is ok.
| Peter77 wrote: |
are you talking about sitemap_forum.php? so I am supposed to use that and not sitemap.php? |
Nope, you should just overwrite the sitemap_forum.php file you are actually using with the one located in contrib/moded_4_mod_rewrites/phpBB_SEO_mod_Rewrites/Advanced_Mod_Rewrite
and you URLs will be outputted rewritten  |
Hmm I didn't know about sitemap_forum.php untill the other day. well it doesn't let me enter. it says hacking attempt. is that normal?
Do you think that maybe I should try the other rewrite rules.. like mixed rewrite or simple rewrite? |
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 13354
|
Posted: Tue May 23, 2006 9:04 am Post subject: Re: Locking the www in urls |
|
|
Please keep your .htaccess with deny from al in it, the only .htaccess that could mess with this www thing are the one containing rewriterules or Options, but deny and .htpasswd are ok.
Then, I think I do not make it to make you understand what I mean with Google sitemaps.
So, your installation is perfect.
You just have to overwrite the original sitemap_forum.php located in mx_ggsitemaps/includes/ with the one located in contrib/moded_4_mod_rewrites/phpBB_SEO_mod_Rewrites/Advanced_Mod_Rewri te
And please re DL the pack if you hadn't already, cause small errors where fixed last week in the contrib folder files
It's just that the sitemap_forum.php is used to output the forums URL, the original one stands for vanilla URL, the others will rewrite URL accordingly to the selected mod rewrite.
And no more to do as far as Google sitemaps, since the forum rewriterules are already set  |
_________________ 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 |
|
 |
Peter77 phpBB SEO Team


Joined: 10 May 2006 Posts: 512 Location: Michigan
|
Posted: Tue May 23, 2006 10:32 am Post subject: Re: Locking the www in urls |
|
|
Okay, sitemap.php is working correctly now.
now just need to get the www issue. sorry if this got off subject. |
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 13354
|
Posted: Wed May 24, 2006 10:44 am Post subject: Re: Locking the www in urls |
|
|
| Peter77 wrote: | Okay, sitemap.php is working correctly now.
now just need to get the www issue. sorry if this got off subject. |
All right
So what about the php script?
and would this work ?
| Code: | Options +FollowSymlinks
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^site.com/$ [NC]
RewriteRule ^(.*) http://www.site.com/$1 [QSA,R=301,L] |
or this :
| Code: | Options +FollowSymlinks
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^site.com/$ [NC]
RewriteRule (.*) http://www.site.com/$1 [QSA,R=301,L] |
or this :
| Code: | Options +FollowSymlinks
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^site.com [NC]
RewriteRule (.*) http://www.site.com/$1 [QSA,R=301,L] |
or this :
| Code: | Options +FollowSymlinks
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^site.com [NC]
RewriteRule ^(.*) http://www.site.com/$1 [QSA,R=301,L] |
or this :
| Code: | Options +FollowSymlinks
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^site.com$ [NC]
RewriteRule ^(.*) http://www.site.com/$1 [QSA,R=301,L] |
or this :
| Code: |
Options +FollowSymlinks
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^site.com$ [NC]
RewriteRule (.*) http://www.site.com/$1 [QSA,R=301,L] |
++ |
_________________ 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 |
|
 |
Peter77 phpBB SEO Team


Joined: 10 May 2006 Posts: 512 Location: Michigan
|
Posted: Wed May 24, 2006 10:48 pm Post subject: Re: Locking the www in urls |
|
|
Okay!! I think I got it... I went to my hosting companys support forum. which has more webmasters then support, and one person told me to use this instead.
| Code: | suPHP_ConfigPath /home/account_name/public_html
Options Indexes Multiviews +FollowSymlinks
RewriteEngine On
# Redirect asdf.net to www.asdf.net
RewriteCond %{HTTP_HOST} ^example\.net [NC]
RewriteRule (.*) http://www.example.net/$1 [R=301] |
and changed mine to
| Code: | suPHP_ConfigPath /home/myaccount/public_html
Options Indexes Multiviews +FollowSymlinks
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteRule (.*) http://www.example.com/$1 [QSA,R=301,L] |
and it seems to work.
But I have the same .css and images problem. this was more my fault i think. I had the .css and some images pointing to http://mysite.com and changed it to http://www.mysite.com and it works fine now.
Only now I have the same issue with mxbb login.php. it refreshes the page instead of logging in. so again, i have to redirect traffic to the phpbb login.php instead.
I don't have the login URL hardcoded or anything. Im using "{U_LOGIN_LOGOUT}" and ">{L_LOGIN_LOGOUT}
| dcz wrote: | and would this work ?
...
|
I had tried them all expect for the last 2, I think. and actually I think suPHP_ConfigPath /home/account_name/public_html was the trick.
| dcz wrote: | | So what about the php script? |
which php script are you talking about? if your talking about the one in viewtopic.php, yes I think that one seems to be working fine - instead of redirecting to a 404 it's redirecting to another page on my site. |
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 13354
|
Posted: Thu May 25, 2006 5:30 am Post subject: Re: Locking the www in urls |
|
|
So you do have special server settings
I had never seen this one so far, good to know. And I confirm it works well for all urls
GOOD
Then, the login thing. I suddenly see something that should no be here in the append_sid function :
Try getting rid of this line, if it appears, in function.php (the phpbb one)
| Code: | | $url = preg_replace("'(?)index.php\?c=([0-9]*)'", "".format_url($seo_cat_name)."-vc\\1.html", $url); |
It should not mess with login, but, it should not be here as well And the "*" was replaced by "+" (more stricty). This line just stayed there after I decided to get rid of it last time I put it together
Make sure though you have :
| Code: | $urlin = array(
"'(?)index.php\?c=([0-9]+)((&)|(&)){0,1}'",
//"'(?)sitemaps([0-9]+)\.html((&)|(&)){0,1}'",
);
$urlout = array(
"".format_url($seo_cat_name)."-vc\\1.html".if_query('\\2')."",
//"".format_url($seo_cat_name)."-sc\\1.html".if_query('\\2')."",
);
$url = preg_replace($urlin, $urlout, $url); |
right after. You can uncomment the two commented line in this one for the mod rewrite for mx sitemaps to 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 |
|
 |
Peter77 phpBB SEO Team


Joined: 10 May 2006 Posts: 512 Location: Michigan
|
Posted: Thu May 25, 2006 6:31 am Post subject: Re: Locking the www in urls |
|
|
| dcz wrote: | So you do have special server settings
I had never seen this one so far, good to know. And I confirm it works well for all urls
GOOD |
I know, for a minute there I thought I had a bad server/hosting.
| dcz wrote: |
Then, the login thing. I suddenly see something that should no be here in the append_sid function :
Try getting rid of this line, if it appears, in function.php (the phpbb one)
| Code: | | $url = preg_replace("'(?)index.php\?c=([0-9]*)'", "".format_url($seo_cat_name)."-vc\\1.html", $url); |
It should not mess with login, but, it should not be here as well And the "*" was replaced by "+" (more stricty). This line just stayed there after I decided to get rid of it last time I put it together
Make sure though you have :
| Code: | $urlin = array(
"'(?)index.php\?c=([0-9]+)((&)|(&)){0,1}'",
//"'(?)sitemaps([0-9]+)\.html((&)|(&)){0,1}'",
);
$urlout = array(
"".format_url($seo_cat_name)."-vc\\1.html".if_query('\\2')."",
//"".format_url($seo_cat_name)."-sc\\1.html".if_query('\\2')."",
);
$url = preg_replace($urlin, $urlout, $url); |
right after. You can uncomment the two commented line in this one for the mod rewrite for mx sitemaps to work  |
I think maybe you meant sessions.php? well I went a head and did the changes... deleted the line you mentioned. cool, thanks for the info on uncommenting those lines. still have the same problem for login.php ( mxbb ) ... so far it's the last 'problem' that I have. not a big worry... I can temporarly redirect traffic to phpbb's login while I find a fix to that.  |
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 13354
|
Posted: Thu May 25, 2006 6:34 am Post subject: Re: Locking the www in urls |
|
|
| Peter77 wrote: |
I think maybe you meant sessions.php? well I went a head and did the changes... deleted the line you mentioned. cool, thanks for the info on uncommenting those lines. still have the same problem for login.php ( mxbb ) ... so far it's the last 'problem' that I have. not a big worry... I can temporarly redirect traffic to phpbb's login while I find a fix to that.  |
oups, and yes, session.php
look at the other commented lines in the code, I think you should uncomment them all (the one with forum-map and the one for mxbb)
And I think we should stop being that off topic and start a new thread for the other matters
++ |
_________________ 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 |
|
 |
legal
Joined: 05 Jul 2006 Posts: 42
|
Posted: Wed Jul 19, 2006 9:26 am Post subject: Re: Locking the www in urls |
|
|
Sorry dcz - posting over here now:
.htaccess file in root:
| Code: | Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.legalitforums\.com$ [NC]
RewriteRule ^(.*) http://www.legalitforums.com/$1 [QSA,L,R=301]
RewriteBase /
#########################################################
# PHPBB SEO REWRITE RULES #
#########################################################
# AUTHOR : DCZ http://www.phpbb-seo.com/
# STARTED : 01/2006
#####################################################
# FORUMS PAGES
########################
# FORUM PROTECTION RULE
RewriteRule ^.+/([^/]+\.html)$ /index.php [R=301,L]
# CATEGORIES
RewriteRule ^.+-vc([0-9]+)\.html$ /index.php?c=$1 [QSA,L]
# PAGINATED FORUM
RewriteRule ^.+-vf([0-9]+)-([0-9]+)\.html$ /viewforum.php?f=$1&start=$2 [QSA,L]
# FORUM
RewriteRule ^.+-vf([0-9]+)\.html$ /viewforum.php?f=$1 [QSA,L]
# PAGINATED TOPIC
RewriteRule ^topic([0-9]+)-([0-9]+)\.html$ /viewtopic.php?t=$1&start=$2 [QSA,L]
# TOPIC
RewriteRule ^topic([0-9]+)\.html$ /viewtopic.php?t=$1 [QSA,L]
# POST
RewriteRule ^post([0-9]+)\.html$ /viewtopic.php?p=$1 [QSA,L]
#PROFILES
RewriteRule ^member([0-9]+)\.html$ /profile.php?mode=viewprofile&u=$1 [QSA,L]
# END PHPBB PAGES
#####################################################
# phpBB
RewriteRule ^sitemaps.xml$ /sitemap.php [L]
RewriteRule ^forum-sitemap-([0-9]+).xml$ /sitemap.php?fid=$1 [L]
RewriteRule ^sitemap-forum.xml$ /sitemap.php?forum [L] |
|
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 13354
|
|
| Back to top |
|
 |
legal
Joined: 05 Jul 2006 Posts: 42
|
Posted: Wed Jul 19, 2006 10:18 am Post subject: Re: Locking the www in urls |
|
|
Thanks it's worked although for some reason it seems to have blocked access to my stats:
mysite.com/stats
I'll check with my host...
 |
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 13354
|
|
| Back to top |
|
 |
legal
Joined: 05 Jul 2006 Posts: 42
|
Posted: Wed Jul 19, 2006 11:31 am Post subject: Re: Locking the www in urls |
|
|
Thanks very much, it did!
 |
|
|
| Back to top |
|
 |
|
|
| Navigation |
Similar Topics |
|
|
|
|
|
|
|