RESOLVED - HTACCESS Redirect viewforum and viewtopic to a directory

Post a reply


This question is a means of preventing automated form submissions by spambots.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

If you wish to attach one or more files enter the details below.

Maximum filesize per attachment: 1 MiB.

Expand view Topic review: RESOLVED - HTACCESS Redirect viewforum and viewtopic to a directory

Re: RESOLVED - HTACCESS Redirect viewforum and viewtopic to a directory

by axew3 » Mon May 15, 2017 8:20 am

Yes it is very possible, but there is a warning SEO about this.
Spiders do not like on same site, the same content repeated.
If you sometime have use big sites like stackoverflow etc, you can see and note how they take care about duplicated questions or contents.
Spiders do not like this. It is implicit in the logic of the code of a crawler.
Imagine: i could repeat same content several times with easy and fill a big site with thousand of pages, with content that maybe differ little one from other.
So, it is not convenient for the site, to have something like this. We could also pass the content of the entire post, as hidden content on page, that the spider will see and index. But after he will found same content in other page/position of same site. This is really bad.

You are speacking only about tags instead .... that can be a very good solution.
Yeah i've put on list this one from long time ... something will be done about ... and some little tip more ;)

By the way as you can see here, to me it is sufficient to have maybe on full forum, a link to iframe for those are coming first time (i will prepare something nice about, just a little js code) on site maybe after a google click that point to full forum. email links already point to iframe, if needed.

Good SeO results are coming from just this main principles: external sites that are linking you, and related content about that maybe match the same arguments of your site. So direct clicks into results, after a search into yahoo,google etc
They use also much more data to calculate the rank of the site for an argument, based on various services they offer, we can imagine (and we hope that they not push who they want in top, discarding someone else). But all lead to the same: content, related clicks, external links your site point to mainly, and links that point to you from external.

Re: RESOLVED - HTACCESS Redirect viewforum and viewtopic to a directory

by SHTFM » Sun May 14, 2017 5:55 pm

Yes that would be good and would be GREAT if you could get the META Tags from the forum and parse them into the wordpress frame for SEO
Like my post here viewtopic.php?iframe=true&f=2&t=526

Re: RESOLVED - HTACCESS Redirect viewforum and viewtopic to a directory

by axew3 » Sun May 14, 2017 2:17 pm

p.s the good solution should be i think:
put eyes on iframe resizer code, and let it send out all vars ... thing that i've still not consider to check if possible.
It send vars onclick ... why not on different event?

Re-solved: HTACCESS Redirect viewforum and viewtopic to a directory

by axew3 » Sun May 14, 2017 2:03 pm

Resolved but just the fixing code for all rewrite, and correct scrolls is coming ...
one have let me lost some time because was really not working in any way.
Finally i've take a not common js solution, guess some other will found a better way but in the while this work.
I mean a link rewrite like this:

Code: Select all

https://www.mysite.com/w3/forums/viewtopic.php?iframe=true&f=2&t=525&e=1&view=unread#unread
as on actual online code, the redirect is wrong. It redirect to the first page, even if the post contain more posts and the showed should be the latest one.
As on online here, the page is correct, but page not scroll to bottom.
SO after some fails, i've resolve with this coming tip:
on page forum, the function function w3all_ajaxup_from_phpbb(res){
should become something like this (This is PSEUDO code, that work)

Code: Select all

function w3all_ajaxup_from_phpbb(res){
	
			var w3all_phpbb_u_logged  = /#w3all_phpbb_u_logged=1/ig.exec(res);
			 if( res.indexOf('#w3all_phpbb_u_logged=') > -1 && w3all_phpbb_u_logged == null && null !== (document.getElementById('wp-admin-bar-my-account')) ){
        window.location.reload(true);
       }
			var w3all_phpbbpmcount = /.*(#w3all_phpbbpmcount)=([0-9]+).*/ig.exec(res);
      if(w3all_phpbbpmcount !== null){
         w3all_ajaxup_from_phpbb_do(w3all_phpbbpmcount[2]);
       }

   if(res.indexOf('#w3allScrollBottom') > -1) {
       setTimeout(w3Resizehs, 200); // delay to scroll
      function w3Resizehs(){
        var h = jQuery('iframe').contents().height();
             this.window.scrollTo(0, 3000);
		   }
		}
		      
} // END function w3all_ajaxup_from_phpbb(res){
and overall_footer.html change this piece of code that start immediately after

Code: Select all

if (window.frameElement) { // if in iframe mode ... to avoid js error w3all_ajaxup_from_phpbb is not a function when forum called not iframe mode (that you can also trascure maybe) if phpBB is surfed by full address and not iframe
//* // remove this line to activate
in this way, where the window location is send out to check on page-forum.php:

Code: Select all

var w3allGetLocation = window.location;
window.onload = function() {
var pmn = "{PRIVATE_MESSAGE_COUNT}";
var w3all_phpbb_u_logged = "{S_USER_LOGGED_IN}";
//
if (w3allGetLocation.indexOf('view=unread') > -1 == true){
 w3allScrollBottom = '#w3allScrollBottom';
} else { w3allScrollBottom = ''; }
// to send to wp at once here, like this: #w3all_phpbbpmcount=val#w3all_phpbbnotifycount=val#etc etc etc
var w3appendevents = '#w3all_phpbbpmcount=' + pmn + '#w3all_phpbb_u_logged=' + w3all_phpbb_u_logged + w3allScrollBottom;
parent.w3all_ajaxup_from_phpbb(w3appendevents);
}
this pseudo code to be finished scroll down page forum, to latest post, and with correct redirect all is perfect.
I guess someone know, how to get the size of iframe, and pass after it to scroll page forum, in different way?
setTimeout(w3Resizehs, 200); // delay to scroll, so the page and iframe has been loaded and page correctly scroll
this work fine ... but really can't exist another way?

Re: HTACCESS Redirect viewforum and viewtopic to a directory

by SHTFM » Sun May 14, 2017 6:42 am

Please mark as [SOLVED]

Re: HTACCESS Redirect viewforum and viewtopic to a directory

by SHTFM » Sun May 14, 2017 6:24 am

Nevermind I figured it out

Code: Select all

RewriteEngine On
RewriteBase /
RewriteRule ^$ - [E=noabort:1]
# Redirect Forum
RewriteCond %{REQUEST_URI} !^/forums-directory/
RewriteRule ^view(.+)\.php$ /forums-directory/$0 [QSA,NC,L,R]

Top