PDA

View Full Version : Mod re-write conversion...


Razasharp
04-02-2005, 02:09 PM
Hi

I've been looking for a Mod-rewrite for vB 3.0.7

I've seen Danis version and the update by Keith - however, there seems to be loads of bugs in there, and it not working for many people, plus nobody seems to want to offer support on that site (or the thread starter/ admin is unwilling to update the initial thread - I even pm'd admin telling them its looking bad on them, ignoring all those requests, but no response).

Anyway I was wondering if anyone could either

A) update the latest version that Keith did as it seems the best ( if it worked!) and post it here (or there),

b) convert the one below that Craven did for phpbb - it worked excellently on my site and additionaly, it only effects guests or non logged in users (I cant see why the vB ones dont also just effect guests!!).

Also C) does anyone know of one that actually works - is well supported and if possible, only effect non logged in users?

i would be really grateful! (as Im sure squilions of others would!)

:-)


################################################## ############
## MOD Title: phpBB static URLs mod_rewrite 1.0.0
## MOD Author: Craven de Kere (N/A) http://www.Able2Know.com
## MOD Description: This mod should be added AFTER the Able2Know.com SEO mod
## This mod makes static URLs (only for guests) for phpBB, for example topic-22234.html
## Please read the author notes BEFORE using this mod.
## Check http://www.able2know.com/forums/about15132.html
## for the latest version or to get help with this MOD
##
## MOD Version: 1.0.0
##
## Installation Level: (Advanced)
## Installation Time: 5 Minutes
## Files To Edit: page_header.php,
## Included Files: n/a
################################################## ############
## Author Notes:
## Use this mod together with the Able2Know.com SEO Mod (http://www.able2know.com/forums/about15132.html)
## Make backups and test this on a test forum if you can. This is not a typical mod.
## For an additional tutorial on preventing IP addresses from being logged see:
## http://www.able2know.com/forums/about22586.html
##
################################################## ############
## MOD History:
##
## 2004-04-10 - Version 1.0.0
## - Initial public release.
##
################################################## ############
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
################################################## ############


#
#-----[ OPEN ]------------------------------------------
#

includes/page_header.php

#
#-----[ FIND ]------------------------------------------
#

//
// Generate logged in/logged out status
//

#
#-----[ AFTER, ADD ]------------------------------------------
#

if ( !$userdata['session_logged_in'] )
{
ob_start();
function replace_for_mod_rewrite(&$s)
{
$urlin =
array(
"'(?<!/)viewforum.php\?f=([0-9]*)&amp;topicdays=([0-9]*)&amp;start=([0-9]*)'",
"'(?<!/)viewforum.php\?f=([0-9]*)&amp;mark=topics'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&amp;watch=topic*'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&amp;unwatch=topic*'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&amp;highlight=*'",
"'(?<!/)viewforum.php\?f=([0-9]*)'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&amp;view=previous'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&amp;view=next'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&amp;postdays=([0-9]*)&amp;postorder=([a-zA-Z]*)&amp;vote=viewresult'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&amp;postdays=([0-9]*)&amp;postorder=([a-zA-Z]*)&amp;start=([0-9]*)'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&amp;start=([0-9]*)&amp;postdays=([0-9]*)&amp;postorder=([a-zA-Z]*)&amp;highlight=([a-zA-Z0-9]*)'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&amp;start=([0-9]*)'",
"'(?<!/)viewtopic.php\?t=([0-9]*)'",
"'(?<!/)viewtopic.php&amp;p=([0-9]*)'",
"'(?<!/)viewtopic.php\?p=([0-9]*)'",
);
$urlout = array(
"topic-\\1-\\2-\\3.html",
"mark-forum\\1.html",
"updates-topic\\1.html",
"stop-updates-topic\\1.html",
"about\\1.html&amp;highlight=\\2",
"forum-\\1.html",
"ptopic\\1.html",
"ntopic\\1.html",
"view-poll\\1-\\2-\\3.html",
"about\\1-\\2-\\3-\\4.html",
"about\\1.html",
"about\\1-\\2.html",
"about\\1.html",
"post-\\1.html",
"post-\\1.html",
);
$s = preg_replace($urlin, $urlout, $s);
return $s;
}
}

#
#-----[ OPEN ]------------------------------------------
#

includes/page_tail.php

#
#-----[ FIND ]------------------------------------------
#

$db->sql_close();

#
#-----[ AFTER, ADD ]------------------------------------------
#

if ( !$userdata['session_logged_in'] )
{
$contents = ob_get_contents();
ob_end_clean();
echo replace_for_mod_rewrite($contents);
global $dbg_starttime;
}

#
#-----[ OPEN ]------------------------------------------
#

.htaccess

#
#-----[ ADD ]------------------------------------------
#

RewriteEngine On
RewriteRule ^forums.* index.php [L,NC]
RewriteRule ^post-([0-9]*).html&highlight=([a-zA-Z0-9]*) viewtopic.php?p=$1&highlight=$2 [L,NC]
RewriteRule ^post-([0-9]*).* viewtopic.php?p=$1 [L,NC]
RewriteRule ^view-poll([0-9]*)-([0-9]*)-([a-zA-Z]*).* viewtopic.php?t=$1&postdays=$2&postorder=$3&vote=viewresult [L,NC]
RewriteRule ^about([0-9]*).html&highlight=([a-zA-Z0-9]*) viewtopic.php?t=$1&highlight=$2 [L,NC]
RewriteRule ^about([0-9]*).html&view=newest viewtopic.php?t=$1&view=newest [L,NC]
RewriteRule ^about([0-9]*)-([0-9]*)-([a-zA-Z]*)-([0-9]*).* viewtopic.php?t=$1&postdays=$2&postorder=$3&start=$4 [L,NC]
RewriteRule ^about([0-9]*)-([0-9]*).* viewtopic.php?t=$1&start=$2 [L,NC]
RewriteRule ^about([0-9]*).* viewtopic.php?t=$1 [L,NC]
RewriteRule ^about([0-9]*).html viewtopic.php?t=$1&start=$2&postdays=$3&postorder=$4&highlight=$5 [L,NC]
RewriteRule ^mark-forum([0-9]*).html* viewforum.php?f=$1&mark=topics [L,NC]
RewriteRule ^updates-topic([0-9]*).html* viewtopic.php?t=$1&watch=topic [L,NC]
RewriteRule ^stop-updates-topic([0-9]*).html* viewtopic.php?t=$1&unwatch=topic [L,NC]
RewriteRule ^forum-([0-9]*).html viewforum.php?f=$1 [L,NC]
RewriteRule ^forum-([0-9]*).* viewforum.php?f=$1 [L,NC]
RewriteRule ^topic-([0-9]*)-([0-9]*)-([0-9]*).* viewforum.php?f=$1&topicdays=$2&start=$3 [L,NC]
RewriteRule ^ptopic([0-9]*).* viewtopic.php?t=$1&view=previous [L,NC]
RewriteRule ^ntopic([0-9]*).* viewtopic.php?t=$1&view=next [L,NC]


#
#-----[ OPEN ]------------------------------------------
#

robots.txt

Disallow: forums/post-*.html$
Disallow: forums/updates-topic.html*$
Disallow: forums/stop-updates-topic.html*$
Disallow: forums/ptopic*.html$
Disallow: forums/ntopic*.html$

#
#-----[ OPEN ]------------------------------------------
#

includes/functions.php

#
#-----[ FIND ]------------------------------------------
#

if (!empty($db))
{
$db->sql_close();
}

#
#-----[ AFTER, ADD ]------------------------------------------
#

if ( !$userdata['session_logged_in'] )
{
if (stristr($url, 'http://')) {
header('Location: ' . $url);
exit;
}
}

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM


anyone have any comments?

Do people think its a good idea or not?

What do YOU think? :-)

Razasharp
04-03-2005, 11:06 PM
anyone?

agiacosa
04-03-2005, 11:50 PM
anyone?
I put together all changes to Keith into a phpBB style mod for vB. I'm waiting for Dani to give me the OK to post. However, there are still problems with the lastest post.

Razasharp
04-03-2005, 11:59 PM
Thanks Agiacosa

Can you PM me a copy please?

Also, you might want to take a look at this: http://forum.modrewrite.com/viewtopic.php?p=2599

it's from a htaccess forum and a nice man there called Caterham has optimised the htaccess bit, I've not tested it but once I get a reliable version of the mod file I will :-)

agiacosa
04-05-2005, 08:10 AM
Thanks Agiacosa

Can you PM me a copy please?

Also, you might want to take a look at this: http://forum.modrewrite.com/viewtopic.php?p=2599

it's from a htaccess forum and a nice man there called Caterham has optimised the htaccess bit, I've not tested it but once I get a reliable version of the mod file I will :-)
I'll try it out. I've PMed you the file.

agiacosa
04-06-2005, 08:23 PM
I'll try it out. I've PMed you the file.
Can someone please help out with this?

ANY MOD-REWRITE experts out there?

Razasharp
04-06-2005, 08:32 PM
Yes can someone please help us convert the phpbb hack I posted in post one please???? its a system that works and thas what we're after ;-)

djwins
04-08-2005, 06:59 PM
This one worked fantastic when my site was on PHPBB
http://www.phprebel.org/weblog/p/phpbb/phpbb_search_engine_indexer.html

demo: http://www.phpbb2.de/archive

agiacosa
04-09-2005, 01:11 PM
Yes, that is similar to the current vB archiver and Zenon's archive hack. This is totally different.

This mod changes URLs to html extensions AND adds the topic to the URL thereby increasing keyword density. Altough this hack is not fully working, Google is indexing my threads much more now and I'm moving up the rankings.

We need someone to take ownership of this and get some fixes done. Unfortunately, the original coders don't seem to be interested in it anymore.

dssmili
04-09-2005, 10:39 PM
Please agicosa PM or email it to me too at mili@dssftp.com

mili

agiacosa
04-10-2005, 10:26 AM
Please agicosa PM or email it to me too at mili@dssftp.com

mili
Done. Let us know how it works out.

dssmili
04-10-2005, 04:17 PM
Thank you very much. Can you please tell us what the bugs are and will doing this mod potentially disable the forum?

mili

agiacosa
04-11-2005, 12:38 PM
Thank you very much. Can you please tell us what the bugs are and will doing this mod potentially disable the forum?

mili
No guarantees on disabling the forum. Some people have it working fine. In my forum, the go to last post feature doesn't work neither does the merge threads.

boiboi
04-11-2005, 06:14 PM
Dani's mod-rewrite works like a charm. I just installed it on 3.0.7. I recieved no error whatsoever. Just take your time and read all the post on keith's update and the 2 changes made on .htaccess and the backslashes that's it. You just got to read the posts.

djwins
04-11-2005, 07:56 PM
Dani's mod-rewrite works like a charm. I just installed it on 3.0.7. I recieved no error whatsoever. Just take your time and read all the post on keith's update and the 2 changes made on .htaccess and the backslashes that's it. You just got to read the posts.
Correct me if I'm wrong, but I thought Dani's mod DOES NOT change the URLs to the topic name (as the phpbb mod I posted above does)?
To me (and more importantly, Google), that is probably one of the most important/useful features.

agiacosa
04-11-2005, 10:12 PM
Correct me if I'm wrong, but I thought Dani's mod DOES NOT change the URLs to the topic name (as the phpbb mod I posted above does)?
To me (and more importantly, Google), that is probably one of the most important/useful features.
That's correct. I had Dani's working fine on my board. However, it does not put the thread title into the URLs as does Keith/Ted's.

Once I implemented Keith/Ted's, Google began to index me well. With some keywords, I've moved into the second search page. That's not bad for me. The problem is that Keith/Ted's doesn't seem to be working in a couple of key places for me.

djwins
04-11-2005, 10:17 PM
The problem is that Keith/Ted's doesn't seem to be working in a couple of key places for me.

Is it just not working for you, or is the hack/mod not finished yet?
As you can tell, I have a great interest in this hack/mod. :squareeyed:

agiacosa
04-11-2005, 10:42 PM
Is it just not working for you, or is the hack/mod not finished yet?
As you can tell, I have a great interest in this hack/mod. :squareeyed:
Many of us do. It works for some and not for others. I don't know why yet.

boiboi
04-12-2005, 05:05 AM
it changes the url to the forum name and the thread or topic name, separating the words with hyphens. yesterday, my forum recorded 243 spiders in less than 24 hours after i installed the mod-rewrite. Forget those $300 SEO kits. this is all you need.

Lizard King
04-12-2005, 05:21 AM
If it is a perfect mode why nobody is trying to fix it out ?

boiboi
04-12-2005, 05:29 AM
If it is a perfect mode why nobody is trying to fix it out ?

Wow. It's fixed except that people just want to cut and paste, so no one reads through the 7 pages of posts. It's not a vb hack that someone support. It's a "tutorial." but it does work. And you can't say it doesn't if you've never tried it.

agiacosa
04-12-2005, 09:39 AM
Wow. It's fixed except that people just want to cut and paste, so no one reads through the 7 pages of posts. It's not a vb hack that someone support. It's a "tutorial." but it does work. And you can't say it doesn't if you've never tried it.
boiboi,

Don't jump to conclusions. I've put together a phpBB2 style mod instruction set that not only takes into account the 7 pages of posts in the Revised Dani thread, but also the original Dani thread (21 pages) and the post at The Admin Zone. I've done all those fixes and still have problems.

If you have it implemented, does your merge threads work? How about the link to go to last post?

boiboi
04-12-2005, 03:37 PM
I have vb 3.0.7 not sure if it works for phpbb

agiacosa
04-12-2005, 05:23 PM
I have vb 3.0.7 not sure if it works for phpbb
It is a vB mod but just in the phpBB2 mod format.

dssmili
04-13-2005, 06:48 AM
It is a disaster here, all links are bad.
I got links like http://www.dssftp.com/forum/f71-.html
Obviously the "-" is n the wrong place or something.

mili

It helps if you don't do this at 4am in the morning.
I forgot to upload the modified PHP files.
It is working fine, will test for bugs tomorrow.

mili

Neutral Singh
04-13-2005, 12:14 PM
You can use conditionals around to Keith's Mod-write hack to restrict its implementation to guest only... just check out my website... i have installed this hack succesfully (username:test, password: test).

Have a look at the Site Navigation Menu (left hand side)... as a guest, you would see some links with .html extensions but as soon as you login... the same links convert to .php extensions... and my google ranking are also improving dramatically after i implemented this modification... :)

i am planning on using conditionals around every modification suggested by Keith...

Regards

in that Kieth's thread on daniweb... the .htaccess file in the packaged in the hack thread is wrong... if you read through the 2-3 pages under that thread, there is another .htaccess file provided which worked perfectly for me.

agiacosa
04-13-2005, 12:53 PM
You can use conditionals around to Keith's Mod-write hack to restrict its implementation to guest only... just check out my website... i have installed this hack succesfully (username:test, password: test).

Have a look at the Site Navigation Menu (left hand side)... as a guest, you would see some links with .html extensions but as soon as you login... the same links convert to .php extensions... and my google ranking are also improving dramatically after i implemented this modification... :)

i am planning on using conditionals around every modification suggested by Keith...

Regards

in that Kieth's thread on daniweb... the .htaccess file in the packaged in the hack thread is wrong... if you read through the 2-3 pages under that thread, there is another .htaccess file provided which worked perfectly for me.
Would you kindly post an example of the conditional statement you used? Also, I would appreciate it if you would post the .htaccess you used.

7casas
04-13-2005, 01:55 PM
It is possible to modify the links of the posts?
Like this:
www.mysite.com/post_title_1
and not:
www.mysite.com/showthread.php?...

Neutral Singh
04-14-2005, 12:00 PM
Would you kindly post an example of the conditional statement you used? Also, I would appreciate it if you would post the .htaccess you used.

Hi agiacosa :)

I have used basic vB conditionals system, for example :
(I preassume that that Keiths Modification are working for you)

<if condition="$show['member']">
> <b><a href=/sikhphilosophy/forumdisplay.php?f=132>Articles</a></b><br />
<else />
> <b><a href=/sikhphilosophy/f132-spn-articles-section.html>Articles Section</a></b><br />
</if>



The .htacess file that did the trick for me was :

RewriteEngine On
Options +FollowSymLinks
RewriteRule ^t([0-9]+)-(.*).html$ showthread.php?t=$1 [L]
RewriteRule ^lastpostinthread([0-9]+).html$ showthread.php?goto=lastpost&t=$1 [L]
RewriteRule ^newpostinthread([0-9]+).html$ showthread.php?goto=newpost&t=$1 [L]
RewriteRule ^f([0-9]+)-(.*).html$ forumdisplay.php?forumid=$1 [L]


I hope it works for you all.

Regards

agiacosa
04-14-2005, 12:34 PM
Hi agiacosa :)

I have used basic vB conditionals system, for example :
(I preassume that that Keiths Modification are working for you)

<if condition="$show['member']">
> <b><a href=/sikhphilosophy/forumdisplay.php?f=132>Articles</a></b><br />
<else />
> <b><a href=/sikhphilosophy/f132-spn-articles-section.html>Articles Section</a></b><br />
</if>



The .htacess file that did the trick for me was :




I hope it works for you all.

Regards
Thank you.

Are you able to merge threads?

Thank you.

Are you able to merge threads?
Also, the mod requires changes to php files. Did you do the conditionals there too?

Neutral Singh
04-15-2005, 10:41 AM
Are you able to merge threads?

i did not face any problem !!

Also, the mod requires changes to php files. Did you do the conditionals there too?

I dare not experiment with any of the php files... i see no need of doing it either. i will only apply these condtionals in the templates such as forumhome, showthread etc.

Regards

Razasharp
04-15-2005, 11:18 AM
Glad it's working for you aman! Howver I noticed that when a thread is spread over more than one page - only page one ends in .html :-(

What would be really nice is if Dani spared a few moments of her time to take a look at what we are asking for (mod rewrite that works and for guests only) and to give us some hints and tips on how to acieve this. Dani is a member and sponser/advertiser here, so perhaps if we all mass PM'd her she might help us! lol

Neutral Singh
04-18-2005, 10:58 AM
LOL !! yeah and then she may perhaps ban each of us from vb.org for spamming... just kidding !! Have you checked up with her website exclusively dedicated to mod-rewrite --> http://www.mod-rewrite.com and in that website, you will also realise that the charges for implementing a mod-rewrite on your webiste are a cool $200. So, if you could manage, its all for the taking. And, this may be the reason why we do not get a specific set of instructions on this issue. Anyways, i am indeed happy with what i could implement on my website. :)

Q-v-n-s-Q
04-22-2005, 10:52 PM
its easy, i install 10 times and work perfect 10 times, this is my other new forums

http://www.efz-tm.net/forums/index.php?

and cheack out the tuts

http://www.efz-tm.net/forums/thread39.html

some peoples could get it to work, just b/c the HTACCESS, so i already fix that bugy perfectly, 1st time i couldnt get it to work problly, but after i fix it the HTACCESS, it work fine for forums home + archive

agiacosa
04-23-2005, 12:25 AM
its easy, i install 10 times and work perfect 10 times, this is my other new forums

http://www.efz-tm.net/forums/index.php?

and cheack out the tuts

http://www.efz-tm.net/forums/thread39.html

some peoples could get it to work, just b/c the HTACCESS, so i already fix that bugy perfectly, 1st time i couldnt get it to work problly, but after i fix it the HTACCESS, it work fine for forums home + archive
It appears you've installed Dani's mod. That one works fine but does not put thread titles into URLs.

djwins
04-23-2005, 04:36 AM
It appears you've installed Dani's mod. That one works fine but does not put thread titles into URLs.
Exactly. And that is probably the most important function of this would-be mod.

agiacosa
04-23-2005, 09:26 AM
Exactly. And that is probably the most important function of this would-be mod.
Someone did another hack that seems very similar at www.onseo.com. Haven't tested it out yet.

Razasharp
04-23-2005, 03:40 PM
Thanks for that link!! Looks like JUST what I was looking for!! Also judging by how small the htaccess file is and the thread support - looks like THE one to use!!

P.s here's the link the actual thread:

http://www.onseo.com/forums/howto-se-friendly-mod-rewrite-of-urls-for-vbulletin.24376

cscgal
04-30-2005, 04:50 AM
Hey there fellas. I just want to give you an update on the DaniWeb mod_rewrite hack - I've updated it to what DaniWeb is currently using, in a whole new tutorial. There is support for multiple pages, Who's Online (no more Unknown locations!), previous / next threads, linear / hybrid / threaded modes, and much more! Enjoy :)

http://www.daniweb.com/tutorials/tutorial22840.html