.htaccess error

phpBB2 SEO Advanced mod Rewrite support forum.
This mods performs URL rewriting for phpBB, injecting categories, forums and topic titles in their URLs.

Moderator: Moderators

.htaccess error

Postby Cobra » Sun Aug 24, 2008 7:26 am

I install the mod again and trying to find the template error.but now i getting another problem.firstly i install in on my pc(local server) then i reupload the file and install it.

here's the .htaccess:


Code: Select all
    # 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

    #####################################################
    # PHPBB SEO REWRITE RULES - ADVANCED
    #####################################################
    # AUTHOR : dcz www.phpbb-seo.com
    # STARTED : 01/2006
    #################################
    # FORUMS PAGES
    ###############
    # FORUM INDEX
    RewriteRule ^forum\.html$ /phpBB3/index.php [QSA,L,NC]
    # FORUM
    RewriteRule ^[a-z0-9_-]*-f([0-9]+)/?(page([0-9]+)\.html)?$ /phpBB3/viewforum.php?f=$1&start=$3 [QSA,L,NC]
    # TOPIC WITH VIRTUAL FOLDER
    RewriteRule ^[a-z0-9_-]*-f([0-9]+)/[a-z0-9_-]*-t([0-9]+)(-([0-9]+))?\.html$ /phpBB3/viewtopic.php?f=$1&t=$2&start=$4 [QSA,L,NC]
    # GLOBAL ANNOUNCES WITH VIRTUAL FOLDER
    RewriteRule ^announces/[a-z0-9_-]*-t([0-9]+)(-([0-9]+))?\.html$ /phpBB3/viewtopic.php?t=$1&start=$3 [QSA,L,NC]
    # TOPIC WITHOUT FORUM ID & DELIM
    RewriteRule ^([a-z0-9_-]*)/?[a-z0-9_-]*-t([0-9]+)(-([0-9]+))?\.html$ /phpBB3/viewtopic.php?forum_uri=$1&t=$2&start=$4 [QSA,L,NC]
    # PROFILES THROUGH USERNAME
    RewriteRule ^member/([^/]+)/?$ /phpBB3/memberlist.php?mode=viewprofile&un=$1 [QSA,L,NC]
    # USER MESSAGES THROUGH USERNAME
    RewriteRule ^member/([^/]+)/(topics|posts)/?(page([0-9]+)\.html)?$ /phpBB3/search.php?author=$1&sr=$2&start=$4 [QSA,L,NC]
    # GROUPS ADVANCED
    RewriteRule ^[a-z0-9_-]*-g([0-9]+)(-([0-9]+))?\.html$ /phpBB3/memberlist.php?mode=group&g=$1&start=$3 [QSA,L,NC]
    # POST
    RewriteRule ^post([0-9]+)\.html$ /phpBB3/viewtopic.php?p=$1 [QSA,L,NC]
    # ACTIVE TOPICS
    RewriteRule ^active-topics(-([0-9]+))?\.html$ /phpBB3/search.php?search_id=active_topics&start=$2&sr=topics [QSA,L,NC]
    # UNANSWERED TOPICS
    RewriteRule ^unanswered(-([0-9]+))?\.html$ /phpBB3/search.php?search_id=unanswered&start=$2&sr=topics [QSA,L,NC]
    # NEW POSTS
    RewriteRule ^newposts(-([0-9]+))?\.html$ /phpBB3/search.php?search_id=newposts&start=$2&sr=topics [QSA,L,NC]
    # THE TEAM
    RewriteRule ^the-team\.html$ /phpBB3/memberlist.php?mode=leaders [QSA,L,NC]
    # HERE IS A GOOD PLACE TO ADD OTHER PHPBB RELATED REWRITERULES

    # FORUM WITHOUT ID & DELIM
    # THESE THREE LINES MUST BE LOCATED AT THE END OF YOUR HTACCESS TO WORK PROPERLY
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^([a-z0-9_-]+)/?(page([0-9]+)\.html)?$ /phpBB3/viewforum.php?forum_uri=$1&start=$3 [QSA,L,NC]
    # END PHPBB PAGES
    #####################################################



But my forum path is /forum

not phpbb3. i try to edit the phpbb3 to forum. but there is another problem. it show localhost/phpbb3


I clear the cache. but still i getting this problem.



Edit:
After that i delete full forum and remoding everything. but still i got this error :cry:
Cobra
PR0
PR0
 
Posts: 50
Joined: Fri Aug 22, 2008 5:57 pm

Advertisement

Postby swiety » Sun Aug 24, 2008 7:50 pm

Your post is a bit messy, but I'll try to help you.

What server app are you using as localhost? XAMPP? Do you enabled mod rewrite in httpd.conf file?
If not, go to xampp\apache\conf\ directory and edit httpd.conf file. All you need to do is uncomment the line (delete # at the begining):
Code: Select all
#LoadModule rewrite_module modules/mod_rewrite.so

and then find:
Code: Select all
AllowOverride None

and change it to:
Code: Select all
AllowOverride All

It appers three times in that file.
Now you have mod rewrite enabled on you localhost.

If you have your forum installed in the root direcotry of localhost e.g.:
Code: Select all
C:\xampp\htdocs\

you need to use the .htaccess file dedicated for root install, e.g.:
Code: Select all
# TOPIC
RewriteRule ^[a-z0-9_-]*-t([0-9]+)\.html$ /viewtopic.php?t=$1 [QSA,L,NC]

but if you have your forum installation in a folder e.g:
Code: Select all
C:\xampp\htdocs\forum\

you need to use the .htaccess file dedicated for folder install, e.g.:
Code: Select all
# TOPIC
RewriteRule ^phpbb/[a-z0-9_-]*-t([0-9]+)\.html$ /phpbb/viewtopic.php?t=$1 [QSA,L,NC]

and if you have localhost/forum change the patch in htaccess, every "phpbb" need to be replaced by "forum". That's all :wink: .

Your .htaccess is completely messed up :!:
You have two different patches in one line...ehhh
Code: Select all
RewriteRule ^forum\.html$ /phpBB3/index.php [QSA,L,NC]

This should looks like:
Code: Select all
RewriteRule ^forum\.html$ /forum/index.php [QSA,L,NC]


and more proper lines for localhost/forum patch:

Code: Select all
#####################################################
# FORUMS PAGES
########################
# FORUM INDEX (un-comment if used)
RewriteRule ^forum/index\.html$ /forum/index.php [QSA,L,NC]
# FORUM PROTECTION RULE
# RewriteRule ^forum/[a-z0-9_-]*/([^/]+\.html)$ /forum/index.php [R=301,L,NC]
# CATEGORIES
RewriteRule ^forum/[a-z0-9_-]*-c([0-9]+)\.html$ /forum/index.php?c=$1 [QSA,L,NC]
# PAGINATED FORUM
RewriteRule ^forum/[a-z0-9_-]*-f([0-9]+)-([0-9]+)\.html$ /forum/viewforum.php?f=$1&start=$2 [QSA,L,NC]
# FORUM
RewriteRule ^forum/[a-z0-9_-]*-f([0-9]+)\.html$ /forum/viewforum.php?f=$1 [QSA,L,NC]
# PAGINATED TOPIC
RewriteRule ^forum/[a-z0-9_-]*-t([0-9]+)-([0-9]+)\.html$ /forum/viewtopic.php?t=$1&start=$2 [QSA,L,NC]
# TOPIC
RewriteRule ^forum/[a-z0-9_-]*-t([0-9]+)\.html$ /forum/viewtopic.php?t=$1 [QSA,L,NC]
# POST
RewriteRule ^forum/post([0-9]+)\.html$ /forum/viewtopic.php?p=$1 [QSA,L,NC]
#PROFILES
RewriteRule ^forum/member([0-9]+)\.html$ /forum/profile.php?mode=viewprofile&u=$1 [QSA,L,NC]
# END forum PAGES
#####################################################


You always put the .htaccess file in the root directory of your localhost which is:
Code: Select all
C:\xampp\htdocs\

when RewriteBase /


Cheers :lol:
swiety
 
Posts: 13
Joined: Tue Mar 11, 2008 8:23 am

Postby Cobra » Sun Aug 24, 2008 11:55 pm

sorry i messed up to explain. firstly i install that in my local server( from my pc). then i uploaded those edited file to my ftp i mean the real server, then i got this error.

when i click to board index it goes to:

-http://localhost/phpBB3

but the real path is:

-http://my site url.com/forum

after i getting this error i install the mod again( not my local server ) and upload it to my server. but still i getting this problrm :?
Cobra
PR0
PR0
 
Posts: 50
Joined: Fri Aug 22, 2008 5:57 pm

Postby swiety » Tue Aug 26, 2008 7:47 am

OK, no prob.
So...proper .htaccess file for patch yoursite.com/forum/ need to looks like this:
Code: Select all
# You could need to un-comment the following line
# Options +FollowSymlinks
RewriteEngine On
RewriteBase /

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


You need to put it is your root direcotry, e.g. if you're using PLESK based server your home (root) directory would be:
Code: Select all
/httpdocs/

Simply, root dir is when the url is "/".

Those rules should make your mod rewrited works well :wink: .
swiety
 
Posts: 13
Joined: Tue Mar 11, 2008 8:23 am

Postby Cobra » Tue Aug 26, 2008 4:35 pm

same problem.

it give the forum link path:
-http://localhost/

:?

i download the pre modded phpbb seo and upload to my server. after that i just replace the config file. but still the same problem. is there are any sql problem?
Cobra
PR0
PR0
 
Posts: 50
Joined: Fri Aug 22, 2008 5:57 pm

Postby dcz » Thu Aug 28, 2008 7:13 am

So this .htaccess suggest that you have activated the virtual root option.

Then, for the phpBB3 path, just update your phpBB config to match your installation, for now it's using "phpBB3/" as script path and it should be forum/ in your case.

Make sure that your server settings in acp are correct, and generate a new .htaccess, it will work ;)

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21219
Joined: Fri Apr 28, 2006 9:03 pm

Postby Cobra » Thu Aug 28, 2008 9:20 am

I am dump. there are some problem about site url path which i don't change after replace new files. now working fine. :D
Cobra
PR0
PR0
 
Posts: 50
Joined: Fri Aug 22, 2008 5:57 pm


Return to phpBB2 Advanced mod Rewrite

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 3 guests