Can't get mod to work, htaccess problem I think??

phpBB2 SEO Mixed mod Rewrite support forum.
This mods performs URL rewriting for phpBB, injecting categories and forums titles in their URLs, but keeping a static rewriting for topics.

Moderator: Moderators

Can't get mod to work, htaccess problem I think??

Postby NonProphet » Mon Dec 15, 2008 10:08 pm

Hey everyone I'm having some problems getting this mod to work on my phpbb forum, I believe the problem is related to my htaccess file.

When I don't use an htaccess file I can access the main page fine and it looks like the mod was installed because the forums point to html links but none of them work. I use the htacess file and then I get an error 404 saying the page can't be found.

The forum index.php file is located here:
htdocs/myforum/forum/index.php

I tried using an htaccess file in htdocs/myforum and htdocs/myforum/forum/ and I ended up getting the same errors for both. Here is my htaccess file:

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/topic([0-9]+)-([0-9]+)\.html$ /forum/viewtopic.php?t=$1&start=$2 [QSA,L,NC]
# TOPIC
RewriteRule ^forum/topic([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
#####################################################



Whenever the htaccess is in the forum folder i get rid of 'forum' parts of the htaccess file.

Any ideas? Thanks.
NonProphet
 
Posts: 4
Joined: Mon Dec 15, 2008 10:03 pm

Advertisement

Postby HB » Tue Dec 16, 2008 12:37 pm

I recommend installing .htaccess in the root and specifying "myforum/forum" as your prefix, e.g.:

Code: Select all
# FORUM
RewriteRule ^myforum/forum/[a-z0-9_-]*-f([0-9]+)\.html$ myforum/forum/viewforum.php?f=$1 [QSA,L,NC]


Otherwise you may want to try removing this line:

Code: Select all
RewriteBase /


since your install as written is not relative to root.
Dan Kehn
HB
phpBB SEO Team
phpBB SEO Team
 
Posts: 1211
Joined: Mon Oct 16, 2006 2:25 am

Postby NonProphet » Tue Dec 16, 2008 11:30 pm

Hey thanks for the response,

I tried both things and I am still having the same problem. Right now I have the htaccess in the root folder and I'm still getting 404 errors.

Any suggestions? Thanks
NonProphet
 
Posts: 4
Joined: Mon Dec 15, 2008 10:03 pm

Postby SeO » Wed Dec 17, 2008 8:38 am

Have you added myforum/forum/ in all your rewriterules as HB suggested you to (eg two time per rewriterule) ?

You could, depending on your server settins, need to add a slash here :
RewriteRule ^myforum/forum/[a-z0-9_-]*-f([0-9]+)\.html$ /myforum/forum/viewforum.php?f=$1 [QSA,L,NC]


in all rewriterules as well.
SeO
Admin
Admin
 
Posts: 6333
Joined: Wed Mar 15, 2006 9:41 pm

Postby NonProphet » Wed Dec 17, 2008 7:45 pm

Still not working... Heres my htaccess:

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/topic([0-9]+)-([0-9]+)\.html$ /forum/viewtopic.php?t=$1&start=$2 [QSA,L,NC]
# TOPIC
RewriteRule ^forum/topic([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
#####################################################



It is located here right now: htdocs/myforum/.htaccess
my forum index and the mod is installed here: htdocs/myforum/forum/index.php

Thanks
NonProphet
 
Posts: 4
Joined: Mon Dec 15, 2008 10:03 pm

Postby SeO » Thu Dec 18, 2008 9:42 am

You should either put the .htaccess in the domain's root (eg in htdocs/) with the full path to your forum mentionned in the rewriterules :
/myforum/forum/ (not only /forum/)

or put it in the forum dir (htdocs/myforum/forum/) and use :
Code: Select all
RewriteBase /myforum/forum/


with no path mentionned in the rewriterules and no right slash :
Code: Select all
RewriteRule ^f[a-z0-9_-]*-c([0-9]+)\.html$ index.php?c=$1 [QSA,L,NC]


and so on with all rewriterules.
SeO
Admin
Admin
 
Posts: 6333
Joined: Wed Mar 15, 2006 9:41 pm

Postby NonProphet » Thu Dec 18, 2008 11:28 pm

Awesome, it looks like its working now.

Thanks a lot for the help everyone, I appreciate it :D
NonProphet
 
Posts: 4
Joined: Mon Dec 15, 2008 10:03 pm


Return to phpBB2 Mixed mod rewrite

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 1 guest