mod rewrite

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

Moderator: Moderators

mod rewrite

Postby Casper » Fri Feb 15, 2008 12:23 am

ok, i have instal a phpbb3SEO.. in site.xx/portal/forum/ and followed instructions, that means, made a .htaccess with "more options" and uploaded it in site.xx/portal/forum/ and rewrite exists but it says 404... that means.. no site under that link..

any clue what is it ?
Casper
 
Posts: 11
Joined: Thu Feb 14, 2008 8:05 pm

Advertisement

Postby Casper » Fri Feb 15, 2008 2:52 am

to make it clearer, ive install the mod...

and when i access the board.. on every link i point.. i c on status bar the link i wanna see.. the link i've put in phpbb class file and in htaccess.. but when i click on that url.. 404... and nothin more.. i'v tried htacces to put in root.. (maybe it beacause the forum folder is 3rd levels.. domain.com/portal/forum/??)...
anyway thanks forward for any kind of help
Casper
 
Posts: 11
Joined: Thu Feb 14, 2008 8:05 pm

Postby Casper » Fri Feb 15, 2008 10:15 am

ok i got the htaccess problem sorted out, but now, the links to the forums are leading to "Forum does not exist." but direct links to topics are working...


LITTLE HELP HERE ???? :-)
Casper
 
Posts: 11
Joined: Thu Feb 14, 2008 8:05 pm

Postby SeO » Fri Feb 15, 2008 1:32 pm

looks like you still have problems with your .htaccess.

Could you post its content here ?
SeO
Admin
Admin
 
Posts: 6333
Joined: Wed Mar 15, 2006 9:41 pm

Postby Casper » Fri Feb 15, 2008 4:16 pm

i repeat only viewforum seems to be not working properly that means every forum url is "Forum doesnt exist"... but every thing other works properly.. users, team leaders, actual topics...

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

# 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 ^pocetna\.html$ index.php [QSA,L,NC]
# FORUM
RewriteRule ^[a-z0-9_-]*-f([0-9]+)/?(stranica([0-9]+)\.ba)?$ 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]+))?\.ba$ viewtopic.php?f=$1&t=$2&start=$4 [QSA,L,NC]
# GLOBAL ANNOUNCES WITH VIRTUAL FOLDER
RewriteRule ^najave/[a-z0-9_-]*-t([0-9]+)(-([0-9]+))?\.ba$ 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]+))?\.ba$ viewtopic.php?t=$1&start=$3 [QSA,L,NC]
# PROFILES THROUGH USERNAME
RewriteRule ^clan/([^/]+)/?$ memberlist.php?mode=viewprofile&un=$1 [QSA,L,NC]
# USER MESSAGES THROUGH USERNAME
RewriteRule ^poruke/([^/]+)/?(stranica([0-9]+)\.ba)?$ search.php?author=$1&sr=posts&start=$3 [QSA,L,NC]
# GROUPS ADVANCED
RewriteRule ^[a-z0-9_-]*-g([0-9]+)(-([0-9]+))?\.ba$ memberlist.php?mode=group&g=$1&start=$3 [QSA,L,NC]
# POST
RewriteRule ^komentar([0-9]+)\.ba$ viewtopic.php?p=$1 [QSA,L,NC]
# THE TEAM
RewriteRule ^uprava\.ba$ 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 ^[a-z0-9_-]+/?(stranica([0-9]+)\.ba)?$ viewforum.php?start=$2 [QSA,L,NC]
# END PHPBB PAGES
#####################################################
Casper
 
Posts: 11
Joined: Thu Feb 14, 2008 8:05 pm

Postby SeO » Fri Feb 15, 2008 4:47 pm

mm I see

So, I see two possible causes.
Is your phpbb_seo/cache/ dir well chmoded, are you able to save seo settings and is the message about the cache dir telling you everything is ok in acp ?
What about the forum url with id, do they work (forum-title-fID.html) ?
Because we need the cache dir up and running to be able to properly use id removal trick, and only the forum urls saved in the cache will work, if you change a forum url, it won't work anymore, the mod will though a 404 header in such case.

If not the cache dir chmod, then, it could be due to URI catching, I never had issue with the method used, but we never know, some weird server setting could lead to some trouble catching the uri (thus the forum-url) before we can match it in the cache.

A link to your forum would definitely help to understand.

To test validity of the uri grabbed, you could temporarily add :

Code: Select all
echo $phpbb_seo->seo_path['uri'];


in includes/functions.php, right before :

Code: Select all
   garbage_collection();
   exit_handler();


You'll see the captured URI displayed at the bottom of your page and will be able to see if it matches. Since you most likely won't be able to try a forum url, try a rewritten topic one and tell me what do you get.
SeO
Admin
Admin
 
Posts: 6333
Joined: Wed Mar 15, 2006 9:41 pm

Postby Casper » Sat Feb 16, 2008 8:59 am

the link is www.lukavac.net/portal/forum/

the cache dir is writeable, and forum-title-xx.html is not working.. all urls are working except the Forum URL ... everyting from index.php (now pocetna.html) to team leadrs (now uprava.ba) .... even i repeat again the direct link to the topic works domain.cc/portal/forum/forum-title/topic-name-txx.ba
but the domain.xx/portal/forum/forum-title/ doesnt work... thanks forward..
Casper
 
Posts: 11
Joined: Thu Feb 14, 2008 8:05 pm

Postby SeO » Sat Feb 16, 2008 9:47 am

mm.

Could you perform the little test I told you about on this url -http://www.lukavac.net/portal/forum/chill-out/

And tell me what do you see (near the footer) ?

As well, could you post here your phpbb_seo/cache/phpbb_cache.php content ?
SeO
Admin
Admin
 
Posts: 6333
Joined: Wed Mar 15, 2006 9:41 pm

Postby Casper » Sat Feb 16, 2008 10:02 am

i tried the test.. but nothin' show up ... nadda... site remains the same as before..

Code: Select all
<?php
/**
* phpBB_SEO Class
* www.phpBB-SEO.com
* @package Advanced phpBB3 SEO mod Rewrite
*/
if (!defined('IN_PHPBB')) {
   exit;
}
$this->cache_config['settings'] = array('url_rewrite'=>true,'modrtype'=>3,'profile_inj'=>true,'profile_noids'=>true,'rewrite_usermsg'=>true,'rem_sid'=>true,'rem_hilit'=>true,'rem_small_words'=>false,'virtual_folder'=>true,'virtual_root'=>false,'cache_layer'=>true,'rem_ids'=>false,'no_dupe'=>array('on'=>true,),'zero_dupe'=>array('on'=>false,'strict'=>true,'post_redir'=>'all',),);
$this->cache_config['forum'] = array(3=>'grad',4=>'podrska',9=>'zabava',10=>'vijesti',11=>'politika',12=>'sport',13=>'zanimljivosti',14=>'nightlife',15=>'caffebar',16=>'kultura',17=>'film',18=>'knjiga',19=>'muzika',20=>'fotografija',21=>'chill-out',22=>'tehnologija',23=>'racunari',24=>'televizija',25=>'mobilna',26=>'automobili',27=>'slike-raje',28=>'skriveni',29=>'skriveno',30=>'lukavacnetforum',31=>'kanta',32=>'opste-teme',33=>'lifestyle',34=>'religija',35=>'svijet',36=>'ona',37=>'muski-kutak',38=>'zenski-kutak',39=>'trzni-centar',40=>'ljubav',41=>'supermarket',42=>'wc',43=>'slike-grada',44=>'dijaspora',45=>'historija',46=>'pozoriste-slikarstvo',47=>'testtera',);
?>
Casper
 
Posts: 11
Joined: Thu Feb 14, 2008 8:05 pm

Postby SeO » Sat Feb 16, 2008 10:11 am

So, it's not the cache, you have everything you need there.

About the test, do you see any additional output while testing a topic url (rewritten) ?

As well, to make sure about the test, could you replace :

Code: Select all
echo $phpbb_seo->seo_path['uri'];


with :

Code: Select all
echo 'captured uri : ' . $phpbb_seo->seo_path['uri'];


So that you'll see "captured uri :" even if the uri captured is empty (which is what looks to occur here).
SeO
Admin
Admin
 
Posts: 6333
Joined: Wed Mar 15, 2006 9:41 pm

Postby Casper » Sat Feb 16, 2008 10:36 am

Code: Select all
captured uri : [phpBB Debug] PHP Notice: in file /viewforum.php on line 32: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3552)

Warning: Cannot modify header information - headers already sent by (output started at /home/lukavac/public_html/portal/forum/includes/functions.php:3552) in /home/lukavac/public_html/portal/forum/includes/functions.php on line 3439

Warning: Cannot modify header information - headers already sent by (output started at /home/lukavac/public_html/portal/forum/includes/functions.php:3552) in /home/lukavac/public_html/portal/forum/includes/functions.php on line 3441

Warning: Cannot modify header information - headers already sent by (output started at /home/lukavac/public_html/portal/forum/includes/functions.php:3552) in /home/lukavac/public_html/portal/forum/includes/functions.php on line 3442

Warning: Cannot modify header information - headers already sent by (output started at /home/lukavac/public_html/portal/forum/includes/functions.php:3552) in /home/lukavac/public_html/portal/forum/includes/functions.php on line 3443


this is what i get..
Casper
 
Posts: 11
Joined: Thu Feb 14, 2008 8:05 pm

Postby SeO » Sun Feb 17, 2008 11:58 am

EG nothing erf:
Code: Select all
captured uri :


So, the used method is in your case unable to grab the URI from the server vars.
Could you tell me more about the server OS you're using ?

So here is how we should be able to circumvent the issue, replace :

Code: Select all
RewriteRule ^[a-z0-9_-]+/?(stranica([0-9]+)\.ba)?$ viewforum.php?start=$2 [QSA,L,NC]


with :
Code: Select all
RewriteRule ^([a-z0-9_-]+)/?(stranica([0-9]+)\.ba)?$ viewforum.php?forum_url=$1start=$3 [QSA,L,NC]


In your .htaccess, then, in viewforum.php, replace :
Code: Select all
   $phpbb_seo->get_forum_id($forum_id, $start);


with :
Code: Select all
   $forum_url = request_var('forum_url', '');
   if (!empty($forum_url)) {
      if ($id = @array_search($forum_url, $phpbb_seo->cache_config['forum']) ) {
         $forum_id = intval($id);
      }
   }


But, it would still be useful to find out how to grab the uri among the server vars on your server, because we need to be able to to this for the zero duplicate.

What I do not fully get either is how the seo_req_uri method could return an empty string, unless $_SERVER['REQUEST_URI'] or $_SERVER['HTTP_X_REWRITE_URL'] or $_SERVER['SCRIPT_NAME'] is always set to "/".
But even, the uri should at lest contain the board full url.

In phpbb_seo/phpbb_seo_class.php :

Code: Select all
$this->seo_path['uri'] = $this->seo_path['root_url'] . str_replace('&amp;', '&', $this->seo_path['uri']);


So, it as well looks like the root url ($this->seo_path['root_url']) is empty.
So please check your forum settings, and make sure you have set the proper domain and path in ACP.
SeO
Admin
Admin
 
Posts: 6333
Joined: Wed Mar 15, 2006 9:41 pm

Postby Casper » Sun Feb 17, 2008 12:33 pm

ok, i ve done repleacement in htaccess and viewforum.. but still everything other works except the viewforum... in ACP i've set domain: www.lukavac.net/portal and script path /forum
still everything other works.. except the viewforum issue..
Casper
 
Posts: 11
Joined: Thu Feb 14, 2008 8:05 pm

Postby Casper » Tue Feb 19, 2008 11:17 am

here's what i've learn from this experiance:

phpBB3 premod can only work properly if in root folder or first level sub folder
only style that phpBB3 premod can look properly is proSilver, all other get CSS breakdown on subForums...

thanks for all your help I've moved my premoded ver to domain.xx/phpbb/ and everything works just fine.. only thing that bothers me is that I cant change the style..
Casper
 
Posts: 11
Joined: Thu Feb 14, 2008 8:05 pm

Postby SeO » Tue Feb 19, 2008 12:06 pm

Do you mean that it is now working without any additional trick ?

If so it could mean that you have something badly configured for phpBB script path in the acp config (phpbb's general tab).

I've actually never tested install like example.com/dir/phpbb/ but there is no obvious reason why it would not work.

About styles, well, all style can be handled, but you need implement the code changes on all of them (either prosilver ones or subsilver2 ones depending on which one is the most similar to yours).

Since you are talking about the premod, you may be interested into reading this (it's always better to post in the proper forum ;) : Prosilver / subsilver2 code changes
SeO
Admin
Admin
 
Posts: 6333
Joined: Wed Mar 15, 2006 9:41 pm

Next

Return to Advanced SEO URL

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 5 guests