url rewrite for a my mod help

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

Moderator: Moderators

url rewrite for a my mod help

Postby Soshen » Sat Mar 24, 2012 3:23 pm

Hello i've made a mod that i like make it works with seo mod.

I need add this lines to htaccess

Code: Select all
# MYCOLLECTION
RewriteRule ^mycollection/manga\.html$ mycollection.php?action=mycstats_manga [QSA,L,NC]
RewriteRule ^mycollection/anime\.html$ mycollection.php?action=mycstats_anime [QSA,L,NC]
RewriteRule ^mycollection/movies\.html$ mycollection.php?action=mycstats_movie [QSA,L,NC]
RewriteRule ^mycollection/videogames\.html$ mycollection.php?action=mycstats_vg [QSA,L,NC]
RewriteRule ^mycollection/superchart\.html$ mycollection.php?action=superchart [QSA,L,NC]
RewriteRule ^mycollection/stats\.html$ mycollection.php?action=mycstats [QSA,L,NC]
#
RewriteRule ^mycollection/([^/]+)/?$ mycollection.php?action=userrecap&uidn=$1 [QSA,L,NC]
RewriteRule ^mycollection/mymanga/([^/]+)/?(page([0-9]+)\.html)?$ mycollection.php?action=mymanga&user_idn=$1&start=$3 [QSA,L,NC]
RewriteRule ^mycollection/myanime/([^/]+)/?(page([0-9]+)\.html)?$ mycollection.php?action=myanime&user_idn=$1&start=$3 [QSA,L,NC]
RewriteRule ^mycollection/mymovies/([^/]+)/?(page([0-9]+)\.html)?$ mycollection.php?action=mymovie&user_idn=$1&start=$3 [QSA,L,NC]
RewriteRule ^mycollection/myvideogames/([^/]+)/?(page([0-9]+)\.html)?$ mycollection.php?action=myvg&user_idn=$1&start=$3 [QSA,L,NC]
RewriteRule ^mycollection/mychart/([^/]+)/?(page([0-9]+)\.html)?$ mycollection.php?action=mychart&user_idn=$1&start=$3 [QSA,L,NC]
#
RewriteRule ^mycollection/wishmanga/([^/]+)/?(page([0-9]+)\.html)?$ mycollection.php?action=mywishmanga&user_idn=$1&start=$3 [QSA,L,NC]
RewriteRule ^mycollection/wishanime/([^/]+)/?(page([0-9]+)\.html)?$ mycollection.php?action=mywishanime&user_idn=$1&start=$3 [QSA,L,NC]
RewriteRule ^mycollection/wishmovies/([^/]+)/?(page([0-9]+)\.html)?$ mycollection.php?action=mywishmovie&user_idn=$1&start=$3 [QSA,L,NC]
RewriteRule ^mycollection/wishvideogames/([^/]+)/?(page([0-9]+)\.html)?$ mycollection.php?action=mywishvg&user_idn=$1&start=$3 [QSA,L,NC]


But when i go in the page writed above some url that do not have in htaccess definition have on url string the text mycollection too.

A example

When i am in viewtopic the acp have url
mydomain.it/forum/adm/index.php

when i am in a custom page like
mydomain.it/forum/mycollection/nick/

the acp url are
mydomain.it/forum/mycollection/nick/adm/index.php

so the script add to the right url mycollection/nick/.

i've tried to add in phpbb_seo_class.php the mycollection.php but it do not solve nothing
Code: Select all
var   $seo_stop_files = array('posting' => 1, 'faq' => 1, 'ucp' => 1, 'swatch' => 1, 'mcp' => 1, 'style' => 1, 'cron' => 1, 'mycollection' => 1);



any help?
Soshen
 
Posts: 4
Joined: Wed Aug 24, 2011 9:26 pm

Advertisement

Re: url rewrite for a my mod help

Postby dcz » Sat Mar 24, 2012 7:24 pm

I think it's a matter of relative urls, when browser sees href="adm/index.php" in mycollection/ (even if it's a virtual directory), they understand mycollection/adm/index.php.

Either use fully qualified url in your links (-http://www.mydomain.it/forum/adm/index.php) or use a base href tag like our url rewriting mod does.

Code: Select all
<base href="http://www.mydomain.it/forum/"/>


in your head section would tell browser to use this base for all relative links.
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: 21407
Joined: Fri Apr 28, 2006 9:03 pm

Re: url rewrite for a my mod help

Postby Soshen » Sun Mar 25, 2012 8:49 am

Well menaging your class i find a way that works too but i do not like so mutch cose is a bit rough.

how do you think?

I need do

in htaccess

add
Code: Select all
RewriteRule ^images($|/) - [L]

cose in my custom page the images aren't loaded too cose the script looking for a image url with my virtual folder too

and at the end change this
Code: Select all
# FIX RELATIVE PATHS : FILES
RewriteRule ^.+/(style\.php|ucp\.php|mcp\.php|faq\.php|download/file.php|search\.php)$ $1 [QSA,L,NC,R=301]
# FIX RELATIVE PATHS : IMAGES
RewriteRule ^.+/(styles/.*|images/.*)/$ $1 [QSA,L,NC,R=301]
# FIX RELATIVE PATHS : ADMIN
RewriteRule ^.+/(adm/.*)$ $1 [QSA,L,NC,R=301]
RewriteRule ^.+/(mycollection/.*)$ $1 [QSA,L,NC,R=301]
RewriteRule ^.+/(images/.*)$ $1 [QSA,L,NC,R=301]


(i've added search.php in first line)

in seo class php

Code: Select all
var   $seo_stop_files = array('posting' => 1, 'faq' => 1, 'ucp' => 1, 'swatch' => 1, 'mcp' => 1, 'style' => 1, 'cron' => 1, 'mycollection' => 1, 'search' => 1);
(added mycollection and search)
var   $seo_stop_vars = array('view=', 'mark=', 'watch=', 'hash=', 'action=');
(added action=)
var   $seo_stop_dirs = array('mycollection', 'images' );
var   $seo_static = array( 'forum' => 'forum', 'topic' => 'topic', 'post' => 'post', 'user' => 'member', 'group' => 'group', 'index' => '', 'global_announce' => 'announces', 'leaders' => 'the-team', 'atopic' => 'active-topics', 'utopic' => 'unanswered', 'npost' => 'newposts', 'urpost' => 'unreadposts', 'pagination' => 'page', 'gz_ext' => '.gz', 'mycollection' => 'mycollection' );
(added mycollection)



doing this seem working but how do you think?
Soshen
 
Posts: 4
Joined: Wed Aug 24, 2011 9:26 pm

Re: url rewrite for a my mod help

Postby dcz » Sun Mar 25, 2012 4:29 pm

I don't think that the addition in phpbb_seo_class.php are of any effect, and what you did in .htaccess is to 301 redirect links that where broken because they where relative in the first place.

Fix your links either one by one (fully qualified url) or all together at once (base href tag), it's better.
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: 21407
Joined: Fri Apr 28, 2006 9:03 pm

Re: url rewrite for a my mod help

Postby Soshen » Sun Mar 25, 2012 8:45 pm

You mean to add in header a js command for href?
But for images? the url of images in my page are broken too.

i've do some test and i find that the line that do something is
'mycollection' => 1, 'search' => 1);

if i add search in $seo_stop_files

when i was in my custom page the search url is ok

if i leave it they have the virtual folder.
Soshen
 
Posts: 4
Joined: Wed Aug 24, 2011 9:26 pm


Return to Advanced SEO URL

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 5 guests