brucey
Joined: 07 Jun 2008 Posts: 34
|
Posted: Sun Jul 20, 2008 4:16 pm Post subject: .htaccess www prefix redirect problem |
|
|
Hi
I am using the mixed seo mod. I have added the .htaccess file, however, I also want to redirect from -http:// to -http://www. (add the prefix)
Yet, when I add it in .htaccess it is simply redirecting the to -http://www. but not redirecting the URL eg /viewforum.php?f=37 to /something
This is my .htaccess file, it even says
| Code: | # HERE IS A GOOD PLACE TO ADD THE WWW PREFIXE REDIRECTION
RewriteCond %{HTTP_HOST} !^www.xxx-bb.org$ [NC]
RewriteRule ^(.*)$ http://www.xxx-bb.org/$1 [R=301,QSA,L] |
| Code: |
# Lines That should already be in your .htacess
<Files "config.php">
Order Allow,Deny
Deny from All
</Files>
<Files "common.php">
Order Allow,Deny
Deny from All
</Files>
# You may need to un-comment the following line
# Options +FollowSymlinks
# REMEBER YOU ONLY NEED TO STARD MOD REWRITE ONCE
RewriteEngine On
# REWRITE BASE
RewriteBase /
# HERE IS A GOOD PLACE TO ADD THE WWW PREFIXE REDIRECTION
RewriteCond %{HTTP_HOST} !^www.xxx-bb.org$ [NC]
RewriteRule ^(.*)$ http://www.xxx-bb.org/$1 [R=301,QSA,L]
#####################################################
# PHPBB SEO REWRITE RULES - MIXED
#####################################################
# AUTHOR : dcz www.phpbb-seo.com
# STARTED : 01/2006
#################################
# FORUMS PAGES
###############
# FORUM INDEX REWRITERULE WOULD STAND HERE IF USED. 'forum' REQUIRES TO BE SET AS FORUM INDEX
# RewriteRule ^forum\.html$ /index.php [QSA,L,NC]
# FORUM
RewriteRule ^[a-z0-9_-]*-f([0-9]+)/?(page([0-9]+)\.html)?$ /viewforum.php?f=$1&start=$3 [QSA,L,NC]
# TOPIC WITH VIRTUAL FOLDER
RewriteRule ^[a-z0-9_-]*-f([0-9]+)/topic([0-9]+)(-([0-9]+))?\.html$
/viewtopic.php?f=$1&t=$2&start=$4 [QSA,L,NC]
# GLOBAL ANNOUNCES WITH VIRTUAL FOLDER
RewriteRule ^announces/topic([0-9]+)(-([0-9]+))?\.html$ /viewtopic.php?t=$1&start=$3 [QSA,L,NC]
# TOPIC WITHOUT FORUM ID & DELIM
RewriteRule ^([a-z0-9_-]*)/?topic([0-9]+)(-([0-9]+))?\.html$
/viewtopic.php?forum_uri=$1&t=$2&start=$4 [QSA,L,NC]
# PROFILES THROUGH USERNAME
RewriteRule ^member/([^/]+)/?$ /memberlist.php?mode=viewprofile&un=$1 [QSA,L,NC]
# USER MESSAGES THROUGH USERNAME
RewriteRule ^member/([^/]+)/(topics|posts)/?(page([0-9]+)\.html)?$
/search.php?author=$1&sr=$2&start=$4 [QSA,L,NC]
# GROUPS ADVANCED
RewriteRule ^[a-z0-9_-]*-g([0-9]+)(-([0-9]+))?\.html$ /memberlist.php?mode=group&g=$1&start=$3
[QSA,L,NC]
# POST
RewriteRule ^post([0-9]+)\.html$ /viewtopic.php?p=$1 [QSA,L,NC]
# ACTIVE TOPICS
RewriteRule ^active-topics(-([0-9]+))?\.html$
/search.php?search_id=active_topics&start=$2&sr=topics [QSA,L,NC]
# UNANSWERED TOPICS
RewriteRule ^unanswered(-([0-9]+))?\.html$ /search.php?search_id=unanswered&start=$2&sr=topics
[QSA,L,NC]
# NEW POSTS
RewriteRule ^newposts(-([0-9]+))?\.html$ /search.php?search_id=newposts&start=$2&sr=topics
[QSA,L,NC]
# THE TEAM
RewriteRule ^the-team\.html$ /memberlist.php?mode=leaders [QSA,L,NC]
# HERE IS A GOOD PLACE TO ADD OTHER PHPBB RELATED REWRITERULES
#########################################################
# GYM Sitemaps & RSS #
#########################################################
# Global channels
RewriteRule ^rss(/(news)+)?(/(digest)+)?(/(short|long)+)?/?$ /gymrss.php?channels&$2&$4&$6 [L,NC]
#########################################################
# END GYM Sitemaps & RSS #
#########################################################
# FORUM WITHOUT ID & DELIM
# THESE FOUR LINES MUST BE LOCATED AT THE END OF YOUR HTACCESS TO WORK PROPERLY
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^([a-z0-9_-]+)/?(page([0-9]+)\.html)?$ /viewforum.php?forum_uri=$1&start=$3 [QSA,L,NC]
# END PHPBB PAGES
#####################################################
#########################################################
# GYM Sitemaps & RSS #
#########################################################
# Main feeds & channels
RewriteRule ^rss(/(news)+)?(/(digest)+)?(/(short|long)+)?(/([a-z0-9_-]+))?/([a-z0-9_]+)\.xml(\.gz)?$
/gymrss.php?$9=$8&$2&$4&$6&gzip=$10 [L,NC]
# Forum feeds
RewriteRule ^[a-z0-9_-]*-f([0-9]+)(/(news)+)?(/(digest)+)?(/(short|long)+)?/([a-z0-9_]+)\.xml(\.gz)?$
/gymrss.php?$8=$1&$3&$5&$7&gzip=$9 [L,NC]
# Module feeds without ids
RewriteRule ^([a-z0-9_-]+)(/(news)+)?(/(digest)+)?(/(short|long)+)?/([a-z0-9_]+)\.xml(\.gz)?$
/gymrss.php?nametoid=$1&$3&$5&$7&modulename=$8&gzip=$9 [L,NC]
# Google SitemapIndex
RewriteRule ^sitemapindex\.xml(\.gz)?$ /sitemap.php?gzip=$1 [L,NC]
# Forum sitemaps
RewriteRule ^[a-z0-9_-]+-f([0-9]+)\.xml(\.gz)?$ /sitemap.php?forum=$1&gzip=$2 [L,NC]
# Module sitemaps
RewriteRule ^([a-z0-9_]+)-([a-z0-9_-]+)\.xml(\.gz)?$ /sitemap.php?$1=$2&gzip=$3 [L,NC]
#########################################################
# END GYM Sitemaps & RSS #
#########################################################
|
Help?
Thanks |
|
|
brucey
Joined: 07 Jun 2008 Posts: 34
|
Posted: Sun Jul 20, 2008 7:39 pm Post subject: Re: .htaccess www prefix redirect problem |
|
|
Nope, its still only adding WWW but not redirecting the whole URL
With extra code you suggested...
| Code: | Checked link: http://xxx-bb.org/viewtopic.php?f=27&t=2249
Type of redirect: 301 Moved Permanently
Redirected to: http://www.xxx-bb.org/viewtopic.php?f=27&t=22
49 |
Without
| Code: | Checked link: http://xxx-bb.org/viewtopic.php?f=27&t=2249
Type of redirect: 301 Moved Permanently
Redirected to: http://www.xxx-bb.org/porn-pictures/topic2249
.html |
So even without the prefix redirect, it still indexing with www. which is fine. But I would still like the main domain to redirect
Any ideas, I have no idea why it's not working |
|
|