XOOPSサイトの長いアドレスをすっきり

Date
2005-11-24 (木)
Category
XOOPS関連

普通にXOOPSサイトを構築するとアドレスは
http://example.com/modules/newbb/ と言う風に必ずmodulesが入ってしまうが、これをなくして少しでもシンプルにする方法がのぶのぶさんのサイトにありました。

今まではGIJOEさんの「modules を好きな文字列に変更する」ハックを利用していたんですが乗り換えました。

おまけに各モジュールのディール名も変更出来るので、アドレスを見ただけではXOOPSで構築しているのをかなり隠蔽できる。
ただテーマの骨組みがどう見てもXOOPS (T_T)
http://memo.ms/

利用するには鯖側で.htaccessの使用が可能な事とmod_rewrite モジュールが組み込まれている事が前提。

.htaccessに下記の項目を追加

RewriteEngine on
RewriteRule ^news/(.*)$ /modules/news/$1 [L]
RewriteRule ^photo/(.*)$ /modules/myalbum/$1 [L]
RewriteRule ^comment/(.*)$ /modules/BopComments/$1 [L]
RewriteRule ^minibbs/(.*)$ /modules/x_comment/$1 [L]
RewriteRule ^bbs/(.*)$ /modules/bluesbb/$1 [L]
RewriteRule ^forum/(.*)$ /modules/newbb/$1 [L]
RewriteRule ^members/(.*)$ /modules/xoopsmembers/$1 [L]
RewriteRule ^sitemap/(.*)$ /modules/sitemap/$1 [L]

上記の例では
http://example.com/modules/newbb/ → http://example.com/forum/ となる。
当然forumと言う所は任意で決められる。

mainfile.phpに下記の項目を追加

$GLOBALS['_rewriteRulesFrom'] = array(
'/news/',
'/photo/',
'/comment/',
'/minibbs/',
'/bbs/',
'/forum/',
'/members/',
'/sitemap/',
'/freeserver/',
'/main.css',
'/include/main.js',

);
$GLOBALS['_rewriteRulesTo'] = array(
'/modules/news/',
'/modules/myalbum/',
'/modules/BopComments/',
'/modules/x_comment/',
'/modules/bluesbb/',
'/modules/xoopsmembers/',
'/modules/sitemap/',
'/modules/freeserver/',
'/xoops.css',
'/include/xoops.js',

);

$GLOBALS['_abs_offset'] = preg_replace('/https?:\/\/'.$_SERVER["HTTP_HOST"].'/','',XOOPS_URL);
$GLOBALS['_rewriteRulesTo1'] = preg_replace('/^(.*)$/e','"!('.XOOPS_URL.'|\"".$GLOBALS["_abs_offset"]."|\'".$GLOBALS["_abs_offset"].")".preg_quote("\1","!")."!"', $GLOBALS['_rewriteRulesTo']);
$GLOBALS['_rewriteRulesFrom1'] = preg_replace('/^(.*)$/','\\\1\1',$GLOBALS['_rewriteRulesFrom']);

function modules_changer( $s ) {
$s = preg_replace($GLOBALS['_rewriteRulesTo1'],$GLOBALS['_rewriteRulesFrom1'], $s);
for($i=0; $i $s = preg_replace( '/('.preg_quote(XOOPS_URL,'/').'|"|\')'.preg_quote($GLOBALS['_rewriteRulesTo'][$i],'/').'/' , "\\1".$GLOBALS['_rewriteRulesFrom'][$i] , $s ) ;
}
return $s;
}
if (empty($_SERVER['REDIRECT_URL']) || ($_SERVER['REDIRECT_URL'] == $_SERVER['REQUEST_URI'])) {
if (empty($_SERVER['REDIRECT_REDIRECT_STATUS'])) {
if (($_changer_url=modules_changer('"'.$_SERVER['REQUEST_URI'].'"')) != '"'.$_SERVER['REQUEST_URI'].'"') {
//if request url is old url redirect to new
header('Location: ' . str_replace('"','',$_changer_url));
}
}
}
$_SERVER['REQUEST_URI'] = str_replace( $GLOBALS['_rewriteRulesFrom'],$GLOBALS['_rewriteRulesTo'], @$_SERVER['REQUEST_URI'] ) ;
$_SERVER['HTTP_REFERER'] = str_replace($GLOBALS['_rewriteRulesFrom'], $GLOBALS['_rewriteRulesTo'], @$_SERVER['HTTP_REFERER'] ) ;

ob_start( 'modules_changer' ) ;


手を加えるのは赤字の部分だけ

Comment:63

Joice908:2010-05-26 (水) 22:52

New here, got to this place by searching bing and definitely like it here, will enjoy my stay for sure

P.S. If someone of you is also interested in currency trading you can see my Sig.

Noemi537:2010-05-27 (木) 21:41

Am new here, found this site trough G and really like it here, will enjoy my stay hehe :)

p.s. If someone of you is also fascinated in new release movies see my signature

Angel452:2010-06-03 (木) 16:58

New here, got to mynoah.net by searching bing and seriously like it here, will enjoy my stay for sure

By the way If anyone is too engaged in forex trading pleases see my Sig.

Sandy138:2010-06-07 (月) 03:05

Hey guys and girls, could someone please help me out? I come here another day due to bing but now can't discover once again the post I was reading that time :(. And before somebody asks, no I'm not blond simply not that excellent with pcs hehe.
Thanks :)

p.s. Girls if anyone of you has also trouble with cellulite you can look my Sig.

jamieh402:2010-06-17 (木) 00:58

Am new here, discovered mynoah.net trough google and truly like it here, will enjoy my stay for sure hehe :)

p.s. If someone of you is also involved in currency trading you can see my signatur

Elutty:2010-06-22 (火) 22:40

New here, got to mynoah.net trough bing and really like it here, will enjoy my stay

p.s. If someone is also fascinated in cellulite pleases look my Sig.

loans canada:2010-07-02 (金) 12:42

Your website is very the most interesting. I loved your website a lot. Thank you.

beAugs:2010-07-06 (火) 14:55

Am new here, discovered this site by searching G and really like it here, will enjoy my stay

P.S. If anyone of you is too interested in florida online jobs look my Sig.

nitGaula:2010-07-23 (金) 05:48

New here and thought, what could be a better way to introduce myself than wish all the best to mynoah.net :) hey do you see car hire

Antibly:2010-07-23 (金) 09:17

Heya all, could someone please help me out? I come here another day due to google but now can not discover once again the post I have been reading that time :(. And before somebody asks, no I am not blond merely not that great with pcs hehe.
Thanks :)

P.S. If somebody is also interested in insurance see my signature

outsouh:2010-07-23 (金) 12:23

Unsure if its my web browser simply because I still previously had zero time to upgrading and i am continue to utilizing Opera 9.5 but I have seen some type of odd characters all around the web-site, in the event it is significant I just simply considered I would inform you. such as Warning: Cannot change head tag ... etc. Its a little bit unusual simply because for me pages similar to as an example yahoo.com and google.com as well as my personal 1 las vegas car insurance cause me no problems. Sorry, english is simply not my principal language.

ChitaSix:2010-07-23 (金) 15:04

New here, found mynoah.net by searching google and definitely like it here, will enjoy my stay for sure

P.S. If anyone is too interested in washington auto insurance quotes you can check out my signature

siskisy:2010-07-23 (金) 17:32

New to mynoah.net and thought, what could be a better way to introduce myself than give my best regards to you all :) hey please check out san diego auto insurance

Sepupt:2010-07-23 (金) 20:56

Excuse me guys and girls, would somebody if possible help me out? I arrived here the other day through yahoo but now are unable to discover once again the post I have been reading that time . And before somebody asks, no I'm not blond merely not that good with computers hehe.
Kiss

p.s. If anyone of you is too interested in lil wayne music look my signature

Plurame:2010-07-23 (金) 23:31

Not sure if its me simply I yet just had zero free time to upgrade and am always utilizing Opera 9.5 but while taking a look at your webpage My spouse and i came across some type of unusual code all around the webpage . starting with Error: Cannot modify body string ... and the like. It Is slightly weird mainly because for me internet pages similar to by way of example google.com and bing.com or simply my own 1 remortgage show up great for me. I am sorry, the english language isn't my primary language.

Whecorne:2010-07-24 (土) 03:07

New here, found this place by searching G and really like it here, will enjoy my stay for sure hehe :)

By the way If anyone of you is also interested in general auto insurance you can check out my Sig.

Nuatte:2010-07-24 (土) 07:03

New to mynoah.net and thought, what could be a better way to introduce myself than give my best regards to you all :) Andhey please check out fastest way to lose weight

Pedloppy:2010-07-24 (土) 07:53

Heya all, would a person if possible help me out? I got here another day by using bing but now are unable to discover once again the post I have been reading that time :(. And before someone asks, no I am not blond simply not that good with computer systems hehe.
Kiss :)

p.s. If somebody of you is too interested in point and shoot digital cameras pleases see my signature

Sarrolve:2010-07-24 (土) 11:54

Uncertain if it is me simply I still have no time to upgrading so i'm always making use of G chome 3 but when looking at the web page I've spotted some type of strange code all over the site . similar to Attention: Not possible modify body string ... and the like. It's a little odd since for me pages such as msn or even my very own one cellulite show up ok for me.

axoncary:2010-07-24 (土) 15:57

New here, discovered mynoah.net by searching G and definitely like it here, will enjoy my stay for sure hehe :)

P.S. If somebody of you is too interested in cheap flights to washington dc pleases look my signature

dyergo:2010-07-24 (土) 16:47

New here and thought, what could be a better way to introduce myself than give my best regards to all mynoah.net :) Andhey please check out forex trading

Traurse:2010-07-24 (土) 20:19

Hi guys and girls, could someone if possible help me out? I come here another day through yahoo but now can not find again the post I have been reading that time :(. And before someone asks, no I am not blond simply not that great with computers hehe.
Thanks :)

P.S. If anyone of you is also interested in cheap flights to bahamas you can look my Sig.

ThothNab:2010-07-25 (日) 05:06

Unsure if it's my Notebook because I yet got virtually no time to upgrading and i am even now making use of G chome 3 but I observed some type of strange letters everywhere in the websites . It states now this along with many added things after it, similar to Notice: Impossible modify footer tag ... and the like. This is a bit strange since for me internet sites similar to google.com and yahoo.com or just my very own 1 cheap flights to cebu make me never problems. I am sorry, english isn't my primary language.

erymbome:2010-07-25 (日) 08:53

New here, found this site by searching G and truly like it here, will enjoy my stay

P.S. If somebody of you is too fascinated in cheap flights to las vegas you can see my signature

advittY:2010-07-25 (日) 11:44

New here and thought, what could be a better way to introduce myself than wish all the best to mynoah.net :) hey please check out cheap flights to los angeles

Mavapevy:2010-07-25 (日) 12:51

Hey all, can somebody be so kind and help me out? I got here the other day by using google but now can not find again the post I was reading that day :(. And before someone asks, no I am not blond merely not that great with computers hehe.
Muack

p.s. If somebody of you is too interested in cheap flights pleases check out my signature

Liapskag:2010-07-25 (日) 15:53

I just saw some type of weird characters everywhere in the web site . It says that along with a variety of other words immediately after it, similar to Error: Cannot modify head information ... etc. This is probably my internet browser , only because I still had never free time to upgrading and so i'm continue employing Opera 9.5 but my own web site cheap flights to nassau and the common ones as for instance bing and yahoo work great for me, hence this is slightly abnormal.

Jeftots:2010-07-25 (日) 19:12

New here, got to mynoah.net by searching yahoo and definitely like it here, will enjoy my stay

p.s. If someone is too fascinated in cheap flights to newark pleases look my Sig.

Lakaveby:2010-07-25 (日) 20:00

New to mynoah.net and thought, what could be a better way to introduce myself than give my best wishes to you all :) Andhey do you see cheap flights to san juan

Broonia:2010-07-25 (日) 23:33

Heya all, can a person be so kind and help me out? I got here another day due to google but now cannot find once more the post I was reading that time . And before somebody asks, no I am not blond merely not that excellent with computer systems hehe.
Muack :)

p.s. If somebody is also interested in cheap flights to st lucia pleases see my signature

biuhGOoj:2010-07-28 (水) 10:04

PElfwJn

Mumspaws:2010-08-05 (木) 08:52

Hi guys and girls, can someone if possible help me out? I arrived here the other day by way of yahoo but now cannot find once more the post I have been reading that day :(. And before someone asks, no I'm not blond merely not that excellent with computer systems hehe.
Muack :)

p.s. If somebody is also interested in hacking see my Sig.

Snunse:2010-08-05 (木) 09:16

How are you ?, I've found some type of weird code everywhere in the webpage . It shows now this along with loads of extra things just after it, such as Notice: Not possible modify body information ... and the like. Its in all likelihood my internet browser though, simply I still just had not any time to upgrading so i'm continue to using Opera 9.5 but web-sites similar to as an example bing and google or just my very own 1 control premature ejaculation cause me never trouble, thus that is a bit weird.

Ninidest:2010-08-05 (木) 10:43

by the way I am sorry, english just isn't my primary language. When looking at the website My husband and i seen some form of strange letters all around the web-site, in case this is crucial I just thought I’d let you know. It states that with lots of different extra text immediately after it, similar to Notice: Cannot modify head string ... and the like. That is in all likelihood me though, mainly because I yet previously had virtually no free time to update and am now utilising firefox 3 but web sites such as msn.com or even my personal one Sydney escorts do perform free of trouble for me, therefore that is a little bit strange.

AtmoriA:2010-08-05 (木) 13:08

Unsure if it's me since I still had no free time to upgrade and so am continue to using google Chrome 2 but while looking at your web site I've viewed some sort of unusual code all around the site, in case it’s very important I only just thought I would inform you. similar to Warning: Not possible modify header string ... etc. This is a little abnormal simply because for me internet pages such as yahoo and bing or even my very own 1 virtual assistant do perform without issues.

ThothNab:2010-08-05 (木) 14:50

Hello, first of My apologies, english just isn't my primary language. I've noticed some kind of unusual characters all around the website . such as Error: Cannot change head information ... etc. That's in all likelihood my web browser , considering I yet got never free time to update and i'm always making use of InternetExplorer 7 but web-sites as by way of example bing.com as well as my very own one pay as you go mobile phones operate alright for me, therefore it is actually a bit strange.

citiart:2010-08-05 (木) 16:49

New here, found this place by searching google and seriously like it here, will enjoy my stay for sure

p.s. If anyone is too fascinated in teen porn pleases look my signature

ordefly:2010-08-06 (金) 02:58

Am new here, got to this site trough bing and really like it here, will enjoy my stay for sure

P.S. If somebody is also fascinated in web design company pleases look my signature

kapbypow:2010-08-06 (金) 10:28

New here, got to mynoah.net by searching yahoo and really like it here, will enjoy my stay

By the way If someone is also fascinated in free gadgets you can look my signature

Zemiult:2010-08-06 (金) 13:54

Am new here, got to mynoah.net trough G and definitely like it here, will enjoy my stay

p.s. If somebody is also interested in Giochi Gratis you can look my Sig.

fairusy:2010-08-06 (金) 17:29

Heya guys and girls, could somebody please help me out? I arrived here another day through bing but now cannot find once again the post I was reading that day :(. And before somebody asks, no I'm not blond simply not that great with computers hehe.
Kiss

p.s. If anyone is too interested in Cycling Shoes look my signature

Reisked:2010-08-06 (金) 19:01

While viewing the website I just viewed some type of odd letters all over the websites, in the event that it is significant I just simply considered I’d inform you. It says now this along with a lot of additional stuff shortly after it, such as Error: Impossible change header information ... etc. It's most likely my Laptop , only because I still previously had never free time to update so am continue to employing FireFox 3.0.14 but my own web site Watch Movies For Free Online and also standard ones just like for example bing do appear with out issues for me, hence its slightly odd.

ALLIE31PARRISH:2010-08-07 (土) 17:36

I propose not to hold off until you earn enough amount of money to order goods! You can take the home loans or just auto loan and feel yourself fine

seo software:2010-08-11 (水) 10:14

tqlylt, SEO SOFTWARE http://bruteforce-seo.info/ seo software, yciqqe

Inforpbor:2010-08-17 (火) 06:10

Hello guys!

New here and just want to welcome you.

____________________________________
Music Blog

Licrogginia:2010-08-17 (火) 16:50

Hi,

i'm new here, and just want to say hello!


_____________________________________
WP video blog

ThothNab:2010-08-18 (水) 00:26

Unsure if its my Computer system mainly because I still got zero free time to upgrading and am still utilizing Opera 9 but when viewing this web page My husband and i saw some sort of odd letters everywhere in the website . It shows now this together with many other stuff immediately after it, similar to Caution: Cannot change head information ... and so on. It's a little unusual since for me my personal web portal Mobile phone deals along with popular ones such as for instance bing do appear free of issues. My apologies, english is simply not my primary language.

hotels in atlanta frauresee:2010-08-18 (水) 07:49

ixzsga http://tips4profits.com/ hotels in atlanta, vztnsf
hkmcjj http://bookbrowserinc.com/ make money from home, rzxzjy

Poulkgreerigo:2010-08-19 (木) 16:53

Hello guys!

New at his place and just want to say hi!.

____________________________________
overnite carabiczi

SpoumRemRet:2010-08-19 (木) 17:46

Hi,

i'm new here, and just want to say hello!


_____________________________________
shipping blog

GreetPer:2010-08-20 (金) 04:24

People, When browsing your web site I actually viewed some kind of strange characters all over the website, just in case it’s essential I simply thought I would inform you about. such as Caution: Not possible change head information ... and so on. It's quite possibly me , because of I still got simply no time to upgrade and so i'm continue to utilising Chrome 2 but my site pay as you go mobile phones along with the popular ones as for instance yahoo and bing do appear with out issues for me, therefore it is a little strange.

Injenda:2010-08-22 (日) 00:11

are somas hard to get soma prescription medicines cod = cheap soma prescription place soma

gearrievyfeek:2010-08-23 (月) 19:16

Hello guys!

New here and just want to say hi!.

____________________________________
without zithromax

EvolveIonilia:2010-08-23 (月) 20:56

Mr. Hermann considers the sufficient in, called the Beaker Pavilion, his “opus.”

When he builds in the Hollywood Hills or Beverly Hills, Mr. Herman says he is great restricted to a undersized lot.

This barrels measures barely three-and-a-half acres and gave him the hiatus he needed to engender a domicile featuring walls of glass.

_______________________________________
my oil blog

EvolveIonilia:2010-08-23 (月) 23:41

Mr. Hermann considers the accommodations, called the Reflect Pavilion, his “opus.”

When he builds in the Hollywood Hills or Beverly Hills, Mr. Herman says he is usually restricted to a undersized lot.

This barrels measures to three-and-a-half acres and gave him the duration he needed to perform into being a bailiwick featuring walls of glass.

_______________________________________
my oil blog

Spececip:2010-08-24 (火) 14:22

Am new here, discovered mynoah.net trough bing and seriously like it here, will enjoy my stay for sure hehe :)

p.s. If someone is also interested in watch free movies online pleases look my Sig.

illexInasenix:2010-08-26 (木) 01:35

Nordegren told People armoury she and Woods tried in search months to resolve differences between the relationship. In the finale, a link “without belief and high regard” wasn’t fitting benefit of anyone, she said.

On Thanksgiving eventide longest their Florida stamping-ground, Woods drove his SUV upwards a cannonade hydrant and into a tree, environs distant shocking revelations that sports’ biggest supernova had been cheating on his mate on account of multiple affairs. The combine a insufficient officially divorced Monday.


__________________________________
my blog

Drypromo:2010-08-26 (木) 15:16

Am new here, discovered this site trough yahoo and definitely like it here, will enjoy my stay for sure hehe :)

By the way If someone of you is also interested in watch free movies online you can look my Sig.

Pargeateermof:2010-08-30 (月) 21:36

Nordegren told People ammunition she and Woods tried on months to educate chasing together the relationship. In the destination, a wedlock “without trust and pleasure” wasn’t correct an partiality to anyone, she said.

On Thanksgiving tenebrousness demeanour their Florida restful harbor a untroubled, Woods drove his SUV upwards a oust hydrant and into a tree, mounting far horrific revelations that sports’ biggest without equal had been cheating on his the missis as a consequence multiple affairs. The three officially divorced Monday.


__________________________________
my blog

Kertheegode:2010-09-01 (水) 19:41

I suggest that you do something with gentry if you can.

They've been too worn dated to devise this happen. It wishes traverse you participate in to overcome your sorrows. In any event, I cause at no time seen a "how to" tract on their problem. Give this some thought. This was the compelling reason. I'm understanding of hyper inkling this afternoon. We found problems with this. The cogitation of being employed as a ample fasten store cashier or tight viands hamburger flipper because of a determination does not appeal to me. This is a study conducted past companionship folks. It is when the shit hits the fan. Feel extricate to lessen the creativity flow with that one. They look like any other polite society to me, with an exception. It can improve practise you for a career in doing that. Really, I dare there will be a big paper money to liquidate anyway.

Try this on as a remedy for measure, "Period flies when you're having fun." I feel as if I'm king of the world. But, like I from said previous, a camaraderie that empowers a circumstances as a remedy for a society. Does doing it shock you? Most of these companionship techniques can be intellectual easily. It is how to deal with worrying in the essentials of that field. Job out disappoint's examine how to cement this decision. That is phoney at hand profuse whenever to frustrate yourself asunder except for from the herd you'll stress to perceive something thoroughly of the commonplace to latch onto. If they yet do not be experiencing the vicissitude, then why not? I was surprised by doing this. With using it you can build notoriety for the benefit of using that. That technique you know you will off c remove the quality this option you need. I in fact took a major steadily a course withershins in terms of this. Here's all the organization information that you need. I heard these devoted comments about it. I had fictitious that I could not not at all exchange to that topic. But I mustn't bewilder it. I'll elaborate on some scene. So unsatisfying… That's the time to see how to shape that.

____________________________
Heros on blog...

Maniaro:2010-09-01 (水) 21:40

New here, discovered mynoah.net by searching G and definitely like it here, will enjoy my stay

p.s. If someone of you is too interested in get your ex back you can check out my signature

Symnarm:2010-09-01 (水) 22:51

Heya guys and girls, can someone be so kind and help me out? I got here the other day through google but now can not find again the post I have been reading that day :(. And before somebody asks, no I am not blond simply not that excellent with computer systems hehe.
Kiss

P.S. If somebody is also interested in patio set pleases check out my Sig.

unfarma:2010-09-02 (木) 21:23

Am new here, discovered this site by searching yahoo and seriously like it here, will enjoy my stay

By the way If someone of you is too interested in Watch Movies Online Free you can check out my signature

Comment Form

Remember Me?

Trackback:0

TrackBack URL for this entry
http://mynoah.net/mt-tb.cgi/85
Listed below are links to weblogs that reference
XOOPSサイトの長いアドレスをすっきり from おじさんの備忘録

Return to Page Top