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  
 
   
.htaccess rewrite I cannot access the pages...

 
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » phpBB mod Rewrite
::  
Author Message
Knodd



Joined: 20 Apr 2008
Posts: 3

.htaccess rewrite I cannot access the pages...Posted: Sun Apr 20, 2008 1:31 pm    Post subject: .htaccess rewrite I cannot access the pages...

Most people use -www.something.*
Me, myself made a copy of live site to my own server at home.
with no www or .* only -http://servername.

Is that bad?

Got these lines on top in .htaccess
Code:
RewriteCond %{HTTP_HOST} ^servername\$ [NC]
RewriteRule ^(.*) http://servername/$1 [QSA,L,R=301]


After wasting more than ten hours googleing and random test I still fail to get rewritemod to work.

I do access ACP, PM's and such, but the rest is not there Sad

I constantly get this is apache error.log
[error] [client ***] File does not exist: /home/www/tip-members-f5.html, referer: -http://servername/


Any hints from you people on what I'm doin wrong?
Or how to find out where tje culprit is?
Back to top
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 13031

.htaccess rewrite I cannot access the pages...Posted: Sun Apr 20, 2008 1:53 pm    Post subject: Re: .htaccess rewrite I cannot access the pages...

So, you are trying to force the domain to be used without the www prefix ?
example.com and not -www.example.com ?

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


Redirects everything but example.com, thus -www.example.com to example.com.

The File does not exist error most likely means that you additonally have a problem with your phpBB rewriterules.

Post here your .htaccess in case you have more 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
Knodd



Joined: 20 Apr 2008
Posts: 3

.htaccess rewrite I cannot access the pages...Posted: Sun Apr 20, 2008 4:21 pm    Post subject: Re: .htaccess rewrite I cannot access the pages...

I don't even use the .com thingy.

Code:
RewriteEngine on

RewriteCond %{HTTP_HOST} ^http://servernname\$ [NC]
RewriteRule ^(.*) http://servername/$1 [QSA,L,R=301]

ErrorDocument 404 /404.php

RewriteBase /

#########################################################
# PHPBB SEO REWRITE RULES                               #
#########################################################
# AUTHOR : dcz http://www.phpbb-seo.com/
# STARTED : 01/2006
#####################################################
# FORUMS PAGES
########################
# FORUM INDEX (un-comment if used)
# RewriteRule ^index\.html$ /index.php [QSA,L,NC]
# FORUM PROTECTION RULE
# RewriteRule ^[a-z0-9_-]+/([^/]+\.html)$ /index.php [R=301,L,NC]
# CATEGORIES
RewriteRule ^[a-z0-9_-]*-c([0-9]+)\.html$ /index.php?c=$1 [QSA,L,NC]
# PAGINATED FORUM
RewriteRule ^[a-z0-9_-]*-f([0-9]+)-([0-9]+)\.html$ /viewforum.php?f=$1&start=$2 [QSA,L,NC]
# FORUM
RewriteRule ^[a-z0-9_-]*-f([0-9]+)\.html$ /viewforum.php?f=$1 [QSA,L,NC]
# PAGINATED TOPIC
RewriteRule ^[a-z0-9_-]*-t([0-9]+)-([0-9]+)\.html$ /viewtopic.php?t=$1&start=$2 [QSA,L,NC]
# TOPIC
RewriteRule ^[a-z0-9_-]*-t([0-9]+)\.html$ /viewtopic.php?t=$1 [QSA,L,NC]
# POST
RewriteRule ^post([0-9]+)\.html$ /viewtopic.php?p=$1 [QSA,L,NC]
#PROFILES
RewriteRule ^member([0-9]+)\.html$ /profile.php?mode=viewprofile&u=$1 [QSA,L,NC]
# END PHPBB PAGES
#####################################################

#########################################################
# GYM SITEMAPS AND RSS REWRITE RULES                    #
#########################################################
# AUTHOR : dcz http://www.phpbb-seo.com/
# STARTED : 2006/02/22
########################
# RSS main
RewriteRule ^rss-?(l|s)?-?(m)?\.(xml(\.gz)?)$ /rss.php?$1&$2 [L]
# RSS forums
RewriteRule ^forums-rss-?(l|s)?-?(m)?\.(xml(\.gz)?)$ /rss.php?forum&c&$1&$2 [L]
# RSS all
RewriteRule ^([a-zA-Z0-9_-]+)-rss([0-9]*)-?(l|s)?-?(m)?\.(xml(\.gz)?)$ /rss.php?$1=$2&$3&$4 [L]
# RSS forum topics
RewriteRule ^.+-rf([0-9]+)-?(l|s)?-?(m)?\.(xml(\.gz)?)$ /rss.php?forum=$1&$2&$3 [L]
# SitemapIndex
RewriteRule ^sitemaps\.(xml(\.gz)?)$ /sitemap.php [L]
# Sitemap modules
RewriteRule ^([a-zA-Z0-9_-]+)-sitemap\.(xml(\.gz)?)$ /sitemap.php?$1 [L]
# Forum Sitemaps
RewriteRule ^.+-gf([0-9]+)\.(xml(\.gz)?)$ /sitemap.php?forum=$1 [L]
# Yahoo! urllist.txt
RewriteRule ^urllist\.(txt(\.gz)?)$ /urllist.php [L]
#########################################################
# END GYM SITEMAPS AND RSS REWRITE RULES                #
#########################################################

# SITEMAP SITE TXT
RewriteRule ^([a-zA-Z0-9_-]+)-gx\.(xml(\.gz)?)$ /sitemap.php?xml=$1 [L]


I did attempt:
RewriteCond %{HTTP_HOST} !servern\$ [NC]

No success Sad
Maybe I shuld mention that I have php5. And phpbb2.20
(Want to upgrade it to 2.23, and want to use an offsite forum, for testing)
Back to top
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 13031

.htaccess rewrite I cannot access the pages...Posted: Sun Apr 20, 2008 4:28 pm    Post subject: Re: .htaccess rewrite I cannot access the pages...

Knodd wrote:
I don't even use the .com thingy.


no tld at all ? private network ?
Could you elaborate a bit ?

And what if you get rid of :
Code:
RewriteCond %{HTTP_HOST} ^http://servernname\$ [NC]
RewriteRule ^(.*) http://servername/$1 [QSA,L,R=301]


is it working ?

By the way, the RewriteCond should use the negate option (! instead of ^), since you only want to redirect what does not match the domain attended, not what matches.

++

_________________
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
Knodd



Joined: 20 Apr 2008
Posts: 3

.htaccess rewrite I cannot access the pages...Posted: Sun Apr 20, 2008 4:37 pm    Post subject: Re: .htaccess rewrite I cannot access the pages...

Yey!
Private.
No one but I should have access to it, perfect place to experiment hacks, upgrades and other additional MODs.

Commented out both lines:
Code:
#RewriteCond %{HTTP_HOST} !servern\$ [NC]
#RewriteRule ^(.*) http://servern/$1 [QSA,L,R=301]

Did not do it.

RewriteCond %{HTTP_HOST} !servern\$
Did not do it either.

[edit]
From this thread
How can I check to see if my server allows mod_rewrite?
I got the first one to fail
Code:
RewriteEngine on
RewriteBase /
RewriteRule ^find\.html$ /found.html [L]


But this one was successful
Code:
RewriteEngine on
RewriteBase /
RewriteRule ^find\.html$ found.html [L]

[/edit]

[more edit]
Suppose I have to learn about regexp in order to "maybe solve this"... Really don't like regexp, to frikkin difficult.
[/edit]

What I did was to mysqldump the database, copied all the contents of ~/public_html to my httpd-root, created the proper user in mysql, and finally edited config.php.

Took some time to realise it was the .htaccess and possibly related to SEO rewrite rules-MOD.


[last edit]
After more than 13 hours of tampering I'm finally givin in, I have to remove URL-rewrite, otherwise I'm wasting my life for nothing.
Will check here as often as I can for solutions.
[/edit]
Back to top
SeO
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 15 Mar 2006
Posts: 2383

.htaccess rewrite I cannot access the pages...Posted: Sun Apr 20, 2008 10:15 pm    Post subject: Re: .htaccess rewrite I cannot access the pages...

Knodd wrote:

But this one was successful
Code:
RewriteEngine on
RewriteBase /
RewriteRule ^find\.html$ found.html [L]



Then this only means that you are in the case where the slash is no required before the right part of the reg ex, it's explained in the .htaccess generator, you can generate one without this slash or just get rid of it manually in the generated .htaccess.

Have you tried the "more option" option ?

_________________
Back to top
Display posts from previous:   
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » phpBB mod Rewrite
Page 1 of 1

Navigation Similar Topics

Jump to: