Koozali.org: home of the SME Server

looking for a mod rewrite rule for a cms

Offline fixit

  • *
  • 216
  • +0/-0
    • http://www.fixitcomputers.com.au
looking for a mod rewrite rule for a cms
« on: September 23, 2006, 09:53:39 AM »
I'm looking for a rewrite rule that will remove metadot from the url, is this possible, as the attempts that i have done so far have not worked. the path needs to be absolute for metadot to load, so is it possible

http://www.mydomain.com/metadot/index.pl

change to

http://www.mydomain.com/index.pl

Thanks, Russell
.........

kmilkos

looking for a mod rewrite rule for a cms
« Reply #1 on: September 25, 2006, 07:40:17 AM »
Set the metadot ibay as the primary content ibay and it will work like charm!

Offline fixit

  • *
  • 216
  • +0/-0
    • http://www.fixitcomputers.com.au
looking for a mod rewrite rule for a cms
« Reply #2 on: September 25, 2006, 08:08:45 AM »
it already is in the Primary ibay
.........

Offline william_syd

  • *****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
looking for a mod rewrite rule for a cms
« Reply #3 on: September 25, 2006, 09:18:23 AM »
Quote from: "fixit"
it already is in the Primary ibay


Is it in a directory called metadot in the Primary iBay?

Can you move it up one level?
Regards,
William

IF I give advise.. It's only if it was me....

Offline fixit

  • *
  • 216
  • +0/-0
    • http://www.fixitcomputers.com.au
looking for a mod rewrite rule for a cms
« Reply #4 on: September 25, 2006, 10:32:16 AM »
I tried moving it up one level, it does not work that easy, I wish it did though. I think I would have to rewrite the whole code of metadot to do that, but I need to find a much easier way,LOL.

I may need to look at something to do with a mod rewrite or maybe something with the template fragment

I can change the Alias to what ever name I want, but thats not what I'm after

Alias /whatever/ /home/e-smith/files/ibays/Primary/html/metadot/

Example of Template

#Metadot

Alias   /images/   /home/e-smith/files/ibays/Primary/html/images/
Alias   /js/      /home/e-smith/files/ibays/Primary/html/js/
Alias /metadot/ /home/e-smith/files/ibays/Primary/html/metadot/
Alias   /public/   /home/e-smith/files/ibays/Primary/html/sitedata/public/
Alias  /skins/    /home/e-smith/files/ibays/Primary/html/sitedata/skins/
Alias  /htmlarea3/ /home/e-smith/files/ibays/Primary/html/js/htmlarea3/
Alias   /private/   /home/e-smith/files/ibays/Primary/html/sitedata/private/

<Directory   /home/e-smith/files/ibays/Primary/html/metadot>
   Options +Indexes
    Options +Includes
   AllowOverride All
   SetHandler   cgi-script
   PerlHandler   speedy::Registry
   PerlSendHeader   On
   Options      +ExecCGI
   AddType application/.html .pl .pm
   DirectoryIndex   index.pl
</Directory>

This html file is associated with it somehow

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta http-equiv="refresh" content="0;url="/metadot/index.pl" />
    <title>Loading</title>
  </head>
  <body onload="document.location='/metadot/index.pl'">
    <!-- the following block was used to allow Firefox to redirect, since
         it has a bug with http-equiv. This is now being fixed with the javascript entry above.
    -->
    <!--
    <div style="margin: 30px; padding: 1em; border: 1px solid #ccc; background-color: #eee;">
      You are being transported to the Metadot portal server.
      <a href="/metadot/index.pl">Click here if you have not been redirected.</a>
    </div>
    -->
  </body>
</html>


Is it possible to change the Alias in the template to use these instead

AliasMatch
ScriptAlias
ScriptAliasMatch


I'm looking for some option that will still load the script, but not show the refernce in the url.

I have tried mod_rewrites in the httpd.conf which will load the index.pl but not metadot.

any ideas on what is a good option to try

Russell
.........

Offline william_syd

  • *****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
looking for a mod rewrite rule for a cms
« Reply #5 on: September 25, 2006, 01:44:41 PM »
Quote from: "MetaDot Forums"
# Rewrite rule to remove /metadot/
RewriteCond %{HTTP_HOST} www.metadot.com
RewriteRule ^/index.pl(.*) /metadot/index.pl$1 [PT]

RewriteCond %{HTTP_HOST} www.metadot.com
RewriteRule ^/userchannel.pl(.*) /metadot/userchannel.pl$1 [PT]


Was being discussed here.
Regards,
William

IF I give advise.. It's only if it was me....

Offline fixit

  • *
  • 216
  • +0/-0
    • http://www.fixitcomputers.com.au
looking for a mod rewrite rule for a cms
« Reply #6 on: September 25, 2006, 02:06:37 PM »
Do you use metadot, if so, did you try that rewrite rule and did it work for you.

For some reason that rule is not working and I have been asking around everywhere on how to remove metadot from the url

Russell
.........

Offline william_syd

  • *****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
looking for a mod rewrite rule for a cms
« Reply #7 on: September 25, 2006, 02:20:19 PM »
I don't use it but everything on the 'net points to this being the way.

Did you alter httpd.conf esp the AllowOverrides bit?

Code: [Select]
<Directory /home/e-smith/files/ibays/Primary/html>
    Options None
    Options +Indexes
    Options +Includes
    AllowOverride None
    order deny,allow
    deny from all
    allow from all
</Directory>


In the accounts db you can add the AllowOverride property.
Regards,
William

IF I give advise.. It's only if it was me....

Offline fixit

  • *
  • 216
  • +0/-0
    • http://www.fixitcomputers.com.au
looking for a mod rewrite rule for a cms
« Reply #8 on: September 25, 2006, 02:27:56 PM »
This is what I have for Primary ibay taken from httpd.conf

<Directory /home/e-smith/files/ibays/Primary/html>
    Options None
    Options +Indexes
    Options +Includes
    AllowOverride All
    order deny,allow
    deny from all
    allow from all
</Directory>
.........

Offline fixit

  • *
  • 216
  • +0/-0
    • http://www.fixitcomputers.com.au
looking for a mod rewrite rule for a cms
« Reply #9 on: September 27, 2006, 03:59:29 AM »
I found the problem, it had nothing to with mod rewrites or .htaccess files, what I did was change the Alias's and modified the index.html

Example of the template fragment

#Metadot Test Server

ServerName www.testserver.local
DocumentRoot "/home/e-smith/files/ibays/Primary/html/metadot/"
Alias /images/ /home/e-smith/files/ibays/Primary/html/images/
Alias /js/ /home/e-smith/files/ibays/Primary/html/js/
Alias /index.pl /home/e-smith/files/ibays/Primary/html/metadot/index.pl
Alias /public/   /home/e-smith/files/ibays/Primary/html/sitedata/public/
Alias /skins/    /home/e-smith/files/ibays/Primary/html/sitedata/skins/
Alias /htmlarea3/ /home/e-smith/files/ibays/Primary/html/js/htmlarea3/
Alias /private/  /home/e-smith/files/ibays/Primary/html/sitedata/private/
Alias /userchannel.pl /home/e-smith/files/ibays/Primary/html/metadot/userchannel.pl

<Directory   "/home/e-smith/files/ibays/Primary/html/metadot">
   Options +Indexes +Includes +FollowSymLinks -MultiViews
    AllowOverride All
   SetHandler   cgi-script
   PerlHandler   speedy::Registry
   PerlSendHeader   On
   Options      +ExecCGI
   AddType application/.html .pl .pm
   DirectoryIndex   index.pl
</Directory>

The index.html  

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="refresh" content="0;url="/index.pl" />
<title>Loading</title>
</head>
<body onload="document.location='/index.pl'">
<!-- the following block was used to allow Firefox to redirect, since
it has a bug with http-equiv. This is now being fixed with the javascript entry above.
-->
<!--
<div style="margin: 30px; padding: 1em; border: 1px solid #ccc; background-color: #eee;">
You are being transported to the Metadot portal server.
<a href="/index.pl">Click here if you have not been redirected.</a>
</div>
-->
</body>
</html>

 :lol:
.........