| |
|
| :: |
| Author |
Message |
Sunburn
Joined: 10 May 2008 Posts: 3
|
Posted: Sat May 10, 2008 11:51 am Post subject: The 404's are becoming a nightmare! |
|
|
Hello,
Just added phpseo advanced, and all seem to go fine.
When getting to the htaccess part, it will not follow the links and gives 404.
While it is quite clear, it is the htaccess causing the problems, no matter how I set it, it still keeps giving 404 following rewrite links.
The forum is in a sub directory, with a wordpress in the root, so don't really want this htaccess in the root, and sticking it in the 'forum' root folder.
I have tried for ages tweaking the htaccess to no avail. Have tried many /forum, /forum/ and / differences here
| Code: | # REWRITE BASE
RewriteBase / |
Can anyone give any ideas, I really want to use this.
Here's a copy of the htaccess (remember as I say above I have played with that line of Rewrite base)
| 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
#####################################################
# PHPBB SEO REWRITE RULES - ADVANCED
#####################################################
# 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/forum\.html$ /forum/index.php [QSA,L,NC]
# FORUM
RewriteRule ^forum/[a-z0-9_-]*-f([0-9]+)(-([0-9]+))?\.html$
/forum/viewforum.php?f=$1&start=$3 [QSA,L,NC]
# TOPIC WITH VIRTUAL FOLDER
RewriteRule ^forum/[a-z0-9_-]*-f([0-9]+)/[a-z0-9_-]*-t([0-9]
+)(-([0-9]+))?\.html$ /forum/viewtopic.php?f=$1&t=$2&start=$4
[QSA,L,NC]
# GLOBAL ANNOUNCES WITH VIRTUAL FOLDER
RewriteRule ^forum/announces/[a-z0-9_-]*-t([0-9]+)(-([0-9]
+))?\.html$ /forum/viewtopic.php?t=$1&start=$3 [QSA,L,NC]
# TOPIC WITHOUT FORUM ID & DELIM
RewriteRule ^forum/([a-z0-9_-]*)/?[a-z0-9_-]*-t([0-9]+)(-([0-
9]+))?\.html$ /forum/viewtopic.php?forum_uri=$1&t=$2&start=$4
[QSA,L,NC]
# PROFILES ADVANCED
RewriteRule ^forum/[a-z0-9_-]*-u([0-9]+)\.html$
/forum/memberlist.php?mode=viewprofile&u=$1 [QSA,L,NC]
# USER MESSAGES ADVANCED
RewriteRule ^forum/[a-z0-9_-]*-u([0-9]+)-(topics|posts)(-([0-
9]+))?\.html$ /forum/search.php?author_id=$1&sr=$2&start=$4
[QSA,L,NC]
# GROUPS ADVANCED
RewriteRule ^forum/[a-z0-9_-]*-g([0-9]+)(-([0-9]+))?\.html$
/forum/memberlist.php?mode=group&g=$1&start=$3 [QSA,L,NC]
# POST
RewriteRule ^forum/post([0-9]+)\.html$ /forum/viewtopic.php?
p=$1 [QSA,L,NC]
# ACTIVE TOPICS
RewriteRule ^forum/active-topics(-([0-9]+))?\.html$
/forum/search.php?search_id=active_topics&start=$2&sr=topics
[QSA,L,NC]
# UNANSWERED TOPICS
RewriteRule ^forum/unanswered(-([0-9]+))?\.html$
/forum/search.php?search_id=unanswered&start=$2&sr=topics
[QSA,L,NC]
# NEW POSTS
RewriteRule ^forum/newposts(-([0-9]+))?\.html$
/forum/search.php?search_id=newposts&start=$2&sr=topics
[QSA,L,NC]
# THE TEAM
RewriteRule ^forum/the-team\.html$ /forum/memberlist.php?
mode=leaders [QSA,L,NC]
# HERE IS A GOOD PLACE TO ADD OTHER PHPBB RELATED REWRITERULES
# 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 ^forum/([a-z0-9_-]+)(-([0-9]+))?\.html$
/forum/viewforum.php?forum_uri=$1&start=$3 [QSA,L,NC]
# END PHPBB PAGES
##################################################### |
|
|
|
| Back to top |
|
 |
|
 |
Sunburn
Joined: 10 May 2008 Posts: 3
|
Posted: Sat May 10, 2008 2:04 pm Post subject: Re: The 404's are becoming a nightmare! |
|
|
okay, I sorted it, with some help from this post
http://www.phpbb-seo.com/boards/advanced-mod-rewrite/discussions-vt1204.html
Now I have no .htaccess in forum directory and just added the wordpress code in .htaccess to the bottom of the phpseo htaccess, and put it in the root, now it works fine.
Another question being, obviously this part should be in forum root still yes?
| 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> |
So I would just have the .htaccess in forum directory with that code, now I have got seo running in the wordpress root? |
|
|
| Back to top |
|
 |
SeO Administrateur - Site Admin

Joined: 15 Mar 2006 Posts: 3103
|
Posted: Sun May 11, 2008 11:42 am Post subject: Re: The 404's are becoming a nightmare! |
|
|
| Sunburn wrote: |
So I would just have the .htaccess in forum directory with that code, now I have got seo running in the wordpress root? |
Glad you make it
And yes, you should keep this in the root's .htaccess, and delete the one in the forum dir, it's not useful anymore if you already have these in the main one.
You can as well keep the original .htaccess in the forum dir, but do not use mod_rewrite in it, would mess up with the rewriterules already set up for the forum in the main one. |
_________________
|
|
| Back to top |
|
 |
Sunburn
Joined: 10 May 2008 Posts: 3
|
Posted: Sun May 11, 2008 11:52 am Post subject: Re: The 404's are becoming a nightmare! |
|
|
Thank you SeO, looks like it's running well so far with the .htaccess sorted out!
Just one more minor thing. The forum frontpage is displayed on either /forum/ or index.php (if I am coming from the ACP back to board). If I rename index.php to index.html, do I need to just make the 1 change in seo_class, and the .htaccess will still be okay as left?
Also, while I'm here. The forum is brand new so no issue using the robots.txt disallowing, would you suggest using it, once index.php has been renamed?
Many thanks for your help!! |
|
|
| Back to top |
|
 |
SeO Administrateur - Site Admin

Joined: 15 Mar 2006 Posts: 3103
|
Posted: Sun May 11, 2008 12:07 pm Post subject: Re: The 404's are becoming a nightmare! |
|
|
| Sunburn wrote: |
Just one more minor thing. The forum frontpage is displayed on either /forum/ or index.php (if I am coming from the ACP back to board). If I rename index.php to index.html, do I need to just make the 1 change in seo_class, and the .htaccess will still be okay as left? |
The .htaccess generator follows this setting as well, but you can edit the one you have already, replacing the commented :
| Code: | | # RewriteRule ^forum/forum\.html$ /forum/index.php [QSA,L,NC] |
with :
| Code: |
RewriteRule ^forum/index\.html$ /forum/index.php [QSA,L,NC] |
if you are using index.html.
As well, make sure you fix the broken line here in the .htaccess you posted above :
| Code: | # FORUM INDEX REWRITERULE WOULD STAND HERE IF USED. 'forum'
REQUIRES TO BE SET AS FORUM INDEX |
In cases it's not done already, because as is, the
| Code: |
REQUIRES TO BE SET AS FORUM INDEX |
line is not commented, and it could be a problem, since it's not valid code.
Use the original :
| Code: | | # FORUM INDEX REWRITERULE WOULD STAND HERE IF USED. 'forum' REQUIRES TO BE SET AS FORUM INDEX |
Instead, or deleted it.
| Sunburn wrote: |
Also, while I'm here. The forum is brand new so no issue using the robots.txt disallowing, would you suggest using it, once index.php has been renamed?
Many thanks for your help!! |
If it's brand new, you can implement the robots.txt right away, if some pages already where indexed, you can let the zero duplicate (to be used in all cases) do it's job and wait few weeks before you do. |
_________________
|
|
| Back to top |
|
 |
|
|
|
|
|