lighttpd

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

Moderator: Moderators

lighttpd

Postby vigge_sWe » Sat Sep 27, 2008 8:03 am

Since apache has some issues on a VPS running centOS I decided to switch to lighttpd. I need someone to convert the mod_rewrite rules to lighttpds url.rewrite rules. Can anyone do it please?

Code: Select all
# 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\.html$ /index.php [QSA,L,NC]
# FORUM
RewriteRule ^[a-z0-9_-]*-f([0-9]+)/?(page([0-9]+)\.html)?$ /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]+))?\.html$ /viewtopic.php?f=$1&t=$2&start=$4 [QSA,L,NC]
# GLOBAL ANNOUNCES WITH VIRTUAL FOLDER
RewriteRule ^announces/[a-z0-9_-]*-t([0-9]+)(-([0-9]+))?\.html$ /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]+))?\.html$ /viewtopic.php?forum_uri=$1&t=$2&start=$4 [QSA,L,NC]
# PROFILES ADVANCED
RewriteRule ^[a-z0-9_-]*-u([0-9]+)/$ /memberlist.php?mode=viewprofile&u=$1 [QSA,L,NC]
# USER MESSAGES ADVANCED
RewriteRule ^[a-z0-9_-]*-u([0-9]+)/(topics|posts)/?(page([0-9]+)\.html)?$ /search.php?author_id=$1&sr=$2&start=$4 [QSA,L,NC]
# GROUPS ADVANCED
RewriteRule ^[a-z0-9_-]*-g([0-9]+)(-([0-9]+))?\.html$ /memberlist.php?mode=group&g=$1&start=$3 [QSA,L,NC]
# POST
RewriteRule ^post([0-9]+)\.html$ /viewtopic.php?p=$1 [QSA,L,NC]
# ACTIVE TOPICS
RewriteRule ^active-topics(-([0-9]+))?\.html$ /search.php?search_id=active_topics&start=$2&sr=topics [QSA,L,NC]
# UNANSWERED TOPICS
RewriteRule ^unanswered(-([0-9]+))?\.html$ /search.php?search_id=unanswered&start=$2&sr=topics [QSA,L,NC]
# NEW POSTS
RewriteRule ^newposts(-([0-9]+))?\.html$ /search.php?search_id=newposts&start=$2&sr=topics [QSA,L,NC]
# THE TEAM
RewriteRule ^the-team\.html$ /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_-]+)/?(page([0-9]+)\.html)?$ /viewforum.php?forum_uri=$1&start=$3 [QSA,L,NC]
# END PHPBB PAGES


WELL DON'T DO IT RIGHT NOW! I may be switching to nginx instead
vigge_sWe
 
Posts: 29
Joined: Sun Oct 07, 2007 10:24 am

Advertisement

Postby dcz » Sat Sep 27, 2008 1:01 pm

Unfortunately, I know very few about lighttpd. But if I remember well, there are few post here talking about it, among which one gives a solution for the phpBB2 case you could inspire from.

Worth a quick search in case you end up needing it ;)

++
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: 21291
Joined: Fri Apr 28, 2006 9:03 pm

Postby vigge_sWe » Sat Sep 27, 2008 2:49 pm

dcz wrote:Unfortunately, I know very few about lighttpd. But if I remember well, there are few post here talking about it, among which one gives a solution for the phpBB2 case you could inspire from.

Worth a quick search in case you end up needing it ;)

++


Actually, I gonna switch over to nginx.

I got a guy to rewrite the rewrite rules. When it is done, I will share it with you :P
vigge_sWe
 
Posts: 29
Joined: Sun Oct 07, 2007 10:24 am

Postby dcz » Sat Oct 04, 2008 7:47 am

vigge_sWe wrote:I got a guy to rewrite the rewrite rules. When it is done, I will share it with you :P


Please do ;)

++
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: 21291
Joined: Fri Apr 28, 2006 9:03 pm

Re: lighttpd

Postby ghostt » Tue May 26, 2009 11:12 am

i need rewrite rules fot Lighttpd.! please
ghostt
 
Posts: 12
Joined: Sun May 03, 2009 9:55 pm

Re:

Postby ghostt » Tue May 26, 2009 5:23 pm

vigge_sWe wrote:
dcz wrote:Unfortunately, I know very few about lighttpd. But if I remember well, there are few post here talking about it, among which one gives a solution for the phpBB2 case you could inspire from.

Worth a quick search in case you end up needing it ;)

++


Actually, I gonna switch over to nginx.

I got a guy to rewrite the rewrite rules. When it is done, I will share it with you :P

share please!!
ghostt
 
Posts: 12
Joined: Sun May 03, 2009 9:55 pm

Re: lighttpd

Postby dcz » Thu May 28, 2009 10:53 am

From what's said in this post Lighttpd AND phpBB URL Rewrite? (where you posted, but it actually seems that you are using phpBB3), you would only need to take adapt each rewriterules by just taking the left part and the right part to fill the url.rewrite array.
Example :
Code: Select all
RewriteRule ^post([0-9]+)\.html$ viewtopic.php?p=$1 [QSA,L,NC]

would become :
Code: Select all
"^/post([0-9]+)\.html$" => "/viewtopic.php?p=$1",


Now, since I do not run any lighttpd install, I assume that you could need to eventually add some paths, or even add some flags (the [QSA,L,NC] part of the mod_rewrite rewriterule), but I cannot tell more precisely. What is for sure is that few test should give you the solution, first try with a single one, like the one I posted and see if it works, and then, apply the same principle on the other ones.
Should do it.

++
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: 21291
Joined: Fri Apr 28, 2006 9:03 pm

Re: lighttpd

Postby ghostt » Fri May 29, 2009 9:51 pm

ive translated whole rewrite rule for the advanced seo url by my self.

"^/[a-z0-9_-]*-f([0-9]+)(-([0-9]+))?\.html" => "/viewforum.php?f=$1&start=$3",
"^/[a-z0-9_-]*-f([0-9]+)/[a-z0-9_-]*-t([0-9]+)(-([0-9]+))?\.html" => "/viewtopic.php?f=$1&t=$2&start=$4",
"^/announces/[a-z0-9_-]*-t([0-9]+)(-([0-9]+))?\.html" => "/viewtopic.php?t=$1&start=$3",
"^/([a-z0-9_-]*)/?[a-z0-9_-]*-t([0-9]+)(-([0-9]+))?\.html" => "/viewtopic.php?forum_uri=$1&t=$2&start=$4",
"^/[a-z0-9_-]*-u([0-9]+)\.html" => "/memberlist.php?mode=viewprofile&u=$1",
"^/[a-z0-9_-]*-u([0-9]+)-(topics|posts)(-([0-9]+))?\.html" => "/search.php?author_id=$1&sr=$2&start=$4",
"^/[a-z0-9_-]*-g([0-9]+)(-([0-9]+))?\.html" => "/memberlist.php?mode=group&g=$1&start=$3",
"^/post([0-9]+)\.html" => "/viewtopic.php?p=$1",
"^/active-topics(-([0-9]+))?\.html" => "/search.php?search_id=active_topics&start=$2&sr=topics",
"^/unanswered(-([0-9]+))?\.html" => "/search.php?search_id=unanswered&start=$2&sr=topics",
"^/newposts(-([0-9]+))?\.html" => "/search.php?search_id=newposts&start=$2&sr=topics",
"^/the-team\.html" => "/memberlist.php?mode=leaders",







the last 2 with the "RewriteCond" are wrong ,cant translate that.

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([a-z0-9_-]+)(-([0-9]+))\.html$ /viewforum.php?forum_uri=$1&start=$3 [QSA,L,NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([a-z0-9_-]+)\.html$ /viewforum.php?forum_uri=$1 [QSA,L,NC]
ghostt
 
Posts: 12
Joined: Sun May 03, 2009 9:55 pm

Re: lighttpd

Postby dcz » Sat May 30, 2009 9:11 am

ghostt wrote:ive translated whole rewrite rule for the advanced seo url by my self.

Good job :D

Unfortunately, I don't know how these RewriteCond can be implemented with lighttpd. Googling this shows that this is kind of THE issue with lighttpd : http://www.google.com/search?q=site:lig ... ewriteCond

So in your case, try to just drop the two RewriteCond and translate the two forum RewriteRule at the very end of your url.rewrite array (by the way, you probably should use the url.rewrite-once to mimic the mod_rewrite L flag and save some resources).

++
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: 21291
Joined: Fri Apr 28, 2006 9:03 pm

Re: lighttpd

Postby tiagofischer » Wed Jun 10, 2009 5:22 pm

It's not complicate to migrate these rewrite condition to lighttpd or nginx.

Example condition:
Code: Select all
RewriteRule ^(forum|[a-z0-9_-]*-f)([0-9]+)(-([0-9]+))?\.html$ /viewforum.php?f=$2&start=$4 [QSA,L,NC]


In Lighttpd:
Code: Select all
$HTTP["host"] =~ "www?\.mysite\.com$" {
        url.rewrite-once = (
                "^(forum|[a-z0-9_-]*-f)([0-9]+)(-([0-9]+))?\.html$" => "/viewforum.php?f=$2&start=$4",
        )
}


In Nginx:
Code: Select all
server {
...
if (!-e $request_filename) {
       rewrite ^/(forum|[a-z0-9_-]*-f)([0-9]+)(-([0-9]+))?\.html$ /viewforum.php?f=$2&start=$4 last;
}
...
}
tiagofischer
 
Posts: 1
Joined: Tue Jun 09, 2009 7:54 pm

Re: lighttpd

Postby Professional » Thu Jun 11, 2009 11:10 am

interesting topic :)
آگهی استخدام - مرجع آموزش موبایل ایرانیان
My Handwritings: Professional Dreams
Every Thing That U Feel,Is Every Thing That I Feel.
User avatar
Professional
PR5
PR5
 
Posts: 549
Joined: Mon Apr 07, 2008 5:41 am
Location: 1/2 of the World

Re: lighttpd

Postby vnboy » Sat Oct 03, 2009 2:25 am

Thanks tiagofischer, I'll try
vnboy
 
Posts: 1
Joined: Sat Oct 03, 2009 2:20 am

Re: lighttpd

Postby arty777 » Thu Jan 21, 2010 10:08 pm

and....
HOW translate this for lighttpd?
Code: Select all
# PHPBB FILES ALL MODES
RewriteRule ^resources/[a-z0-9_-]+/(thumb/)?([0-9]+)$ /download/file.php?id=$2&t=$1 [QSA,L,NC]

# FORUM WITHOUT ID & DELIM ALL MODES (SAME DELIM)
# THESE THREE LINES MUST BE LOCATED AT THE END OF YOUR HTACCESS TO WORK PROPERLY
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z0-9_-]+)/?(page([0-9]+)\.html)?$ /viewforum.php?forum_uri=$1&start=$3 [QSA,L,NC]

# FIX RELATIVE PATHS : FILES
RewriteRule ^.+/(style\.php|ucp\.php|mcp\.php|faq\.php|download/file.php)$ /$1 [QSA,L,NC,R=301]

# FIX RELATIVE PATHS : IMAGES
RewriteRule ^.+/(styles/.*|images/.*)/$ /$1 [QSA,L,NC,R=301]



help please !
arty777
 
Posts: 14
Joined: Tue Jan 19, 2010 2:16 pm

Re: lighttpd

Postby pinkflozd » Wed May 12, 2010 8:44 pm

hey guys. i've translate the rules myself. so here is my rewrite rules for lighttpd

Code: Select all
# PHPBB SEO REWRITE RULES ALL MODES
#####################################################
# AUTHOR : Luka K. www.varjanta.com
# STARTED : 05/2010
#################################
# FORUMS PAGES
###############
# FORUM INDEX REWRITERULE WOULD STAND HERE IF USED. "forum" REQUIRES TO BE SET AS FORUM INDEX
# "^/forum/forum\.html$ /forum/index.php [QSA,L,NC]
# FORUM ALL MODES
"^/forum/[a-z0-9_-]*-f([0-9]+)(-([0-9]+))?\.html" => "/forum/viewforum.php?f=$1&start=$3",
# TOPIC WITH VIRTUAL FOLDER ALL MODES
"^/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",
# GLOBAL ANNOUNCES WITH VIRTUAL FOLDER ALL MODES
"^/forum/announces/[a-z0-9_-]*-t([0-9]+)(-([0-9]+))?\.html" => "/forum/viewtopic.php?t=$1&start=$3",
# TOPIC WITHOUT FORUM ID & DELIM ALL MODES
"^/forum/([a-z0-9_-]*)/?[a-z0-9_-]*-t([0-9]+)(-([0-9]+))?\.html" => "/forum/viewtopic.php?forum_uri=$1&t=$2&start=$4",
# PHPBB FILES ALL MODES
"^/forum/resources/[a-z0-9_-]+/(thumb/)?([0-9]+)$" => "/forum/download/file.php?id=$2&t=$1",
"^/forum/resources/[a-z0-9_-]+/(thumb/)?([0-9]+)/.+$" => "/forum/download/file.php?id=$2&t=$1",


# PROFILES ALL MODES WITH ID
"^/forum/[a-z0-9_-]*-u([0-9]+)\.html" => "/forum/memberlist.php?mode=viewprofile&u=$1",
# USER MESSAGES ALL MODES WITH ID
"^/forum/(member|[a-z0-9_-]*-u)([0-9]+)-(topics|posts)(-([0-9]+))?\.html$" => "/forum/search.php?author_id=$2&sr=$3&start=$5",
# GROUPS ALL MODES
"^/forum/[a-z0-9_-]*-g([0-9]+)(-([0-9]+))?\.html" => "/forum/memberlist.php?mode=group&g=$1&start=$3",
# POST
"^/forum/post([0-9]+)\.html" => "/forum/viewtopic.php?p=$1",
# ACTIVE TOPICS
"^/forum/active-topics(-([0-9]+))?\.html" => "/forum/search.php?search_id=active_topics&start=$2&sr=topics",
# UNANSWERED TOPICS
"^/forum/unanswered(-([0-9]+))?\.html" => "/forum/search.php?search_id=unanswered&start=$2&sr=topics",
# NEW POSTS
"^/forum/newposts(-([0-9]+))?\.html" => "/forum/search.php?search_id=newposts&start=$2&sr=topics",
# UNREAD POSTS
"^/forum/unreadposts(-([0-9]+))?\.html" => "/forum/search.php?search_id=unreadposts&start=$2",
# THE TEAM
"^/forum/the-team\.html" => "/forum/memberlist.php?mode=leaders",

#####################################################
# GYM Sitemaps & RSS
# Global channels
"^/forum/rss(/(news)+)?(/(digest)+)?(/(short|long)+)?/?$" => "/forum/gymrss.php?channels&$2&$4&$6",
"^/forum/(news|maps)/?(page([0-9]+)\.html)?$" => "/forum/map.php?$1&start=$3",
# END GYM Sitemaps & RSS
#####################################################

# FORUM WITHOUT ID & DELIM ALL MODES (SAME DELIM)
"^/forum/([a-z0-9_-]+)(-([0-9]+))\.html" => "/forum/viewforum.php?forum_uri=$1&start=$3",
"^/forum/([a-z0-9_-]+)\.html" => "/forum/viewforum.php?forum_uri=$1",
# FIX RELATIVE PATHS : FILES
"^/forum/.+/(style\.php|ucp\.php|mcp\.php|faq\.php|download/file.php)$" => "/forum/$1",
# FIX RELATIVE PATHS : IMAGES
"^/forum/.+/(styles/.*|images/.*)/$" => "/forum/$1",
# END PHPBB PAGES
#####################################################

#####################################################
# GYM Sitemaps & RSS
# HTML Module additional modes
"^/forum/(news|maps)/([a-z0-9_-]+)(/([a-z0-9_-]+))?/?(page([0-9]+)\.html)?$" => "/forum/map.php?$2=$4&$1&start=$6",
# Main feeds & channels
"^/forum/rss(/(news)+)?(/(digest)+)?(/(short|long)+)?(/([a-z0-9_-]+))?/([a-z0-9_]+)\.xml(\.gz)?$" => "/forum/gymrss.php?$9=$8&$2&$4&$6&gzip=$10",
# Module feeds
"^/forum/[a-z0-9_-]*-[a-z]{1,2}([0-9]+)(/(news)+)?(/(digest)+)?(/(short|long)+)?/([a-z0-9_]+)\.xml(\.gz)?$" => "/forum/gymrss.php?$8=$1&$3&$5&$7&gzip=$9",
# Module feeds without ids
"^/forum/([a-z0-9_-]+)(/(news)+)?(/(digest)+)?(/(short|long)+)?/([a-z0-9_]+)\.xml(\.gz)?$" => "/forum/gymrss.php?nametoid=$1&$3&$5&$7&modulename=$8&gzip=$9",
# Google SitemapIndex
"^/forum/sitemapindex\.xml(\.gz)?$" => "/forum/sitemap.php?gzip=$1",
# Module cat sitemaps
"^/forum/[a-z0-9_-]+-([a-z]{1,2})([0-9]+)\.xml(\.gz)?$" => "/forum/sitemap.php?module_sep=$1&module_sub=$2&gzip=$3",
# Module sitemaps
"^/forum/([a-z0-9_]+)-([a-z0-9_-]+)\.xml(\.gz)?$" => "/forum/sitemap.php?$1=$2&gzip=$3",
# END GYM Sitemaps & RSS
#####################################################
pinkflozd
 
Posts: 1
Joined: Wed May 12, 2010 11:34 am

Re: lighttpd

Postby arty777 » Sat May 15, 2010 9:07 pm

I need for portal :)))

???
arty777
 
Posts: 14
Joined: Tue Jan 19, 2010 2:16 pm

Next

Return to Advanced SEO URL

Who is online

Users browsing this forum: psbot [Picsearch] and 5 guests