Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Results 1 to 15 of 15

This is a discussion on .htaccess and Mod-Rewrite in the Shared & Semi-Dedicated forum
G'day there, I'm in the process of trying to setup the Etomite content management system to power a new web site. A feature of Etomite ...

  1. #1
    JPC Addict lloyd_borrett's Avatar
    Join Date
    May 2004
    Location
    Melbourne, Australia
    Posts
    132

    .htaccess and Mod-Rewrite

    G'day there,

    I'm in the process of trying to setup the Etomite content management system to power a new web site.

    A feature of Etomite is that it supports user/search engine friendly URLs via .htaccess and Mod-Rewrite.

    The details given say:

    Make sure that your Apache configuration file (httpd.conf) is set to allow overrides and that Mod-Rewrite is installed. This will allow you to take advantage of Friendly URLs in Etomite 0.6 and above.

    If your etomite directory is not the root directory of the server and your url is construct as http://yourserver/~yourEtomiteSite you must edit the .htaccess file and add the following parameter "Rewrite Base? /yourEtomiteSite /" for use the Rewrite Engine
    Can someone please tell me if my JaguarPC setup conforms to these requirements? Am I going to be able to use this feature as a part of the standard setup, or will JaguarPC support and/or me, have to do something to get it working? Or can't it be done at all on the JaguarPC server setup?

    I'm not that up-to-speed on Linux and .htaccess, thus I'd appeciate any help I can getting this to work.

    For example, am I going to need to a Rewite Base parameter to the .htaccess file?

    Best Regards,
    Lloyd Borrett.
    Last edited by lloyd_borrett; 06-06-2005 at 07:11 PM.

  2. #2
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    No problem!

    My '.htaccess' is 36K - mostly Mod-rewrite...
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  3. #3
    JPC Addict lloyd_borrett's Avatar
    Join Date
    May 2004
    Location
    Melbourne, Australia
    Posts
    132
    Thanks,

    So I can do it. I just need to find out how.

    My current .htaccess file is:

    #
    # URL rewriting for Etomite CMS
    # Copyright AAB '04
    #
    # To use friendly URLs for Etomite you need to uncomment the three Rewrite directives
    # Make sure RewriteBase points to the directory where you installed Etomite
    # e.g. / if your installation is in root
    # or /Etomite if your installation is in the Etomite subdirectory
    #
    #
    # You must be running on Apache with mod_rewrite to be able to use this functionality.
    #

    php_flag zlib.output_compression On
    php_value zlib.output_compression_level 5

    RewriteEngine On

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
    Any idea as to what it needs to be for me to get it Etomite friendly URLs working properly?

    Best Regards, Lloyd.

  4. #4
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    Quote Originally Posted by lloyd_borrett
    I'm not that up-to-speed on Linux and .htaccess, thus I'd appeciate any help I can getting this to work...
    Oh, BTW, there are a lot of ppl here that understand 'mod_rewrite' (which is really unusual - believe me). Dittos for '.htaccess'. So, you shouldn't have any trouble getting plenty of help...
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  5. #5
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    Quote Originally Posted by lloyd_borrett
    Any idea as to what it needs to be for me to get it Etomite friendly URLs working properly?
    I take it Etomite isn't in your root directory, right?
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  6. #6
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    Personally, I'd get rid of that compression jazz. That's just asking for trouble...
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  7. #7
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    Quote Originally Posted by lloyd_borrett
    My current .htaccess file...
    Um... I have '.htaccess' files all over the place. Assuming you aren't running Etomite in your root directory, where are you putting this '.htaccess' file?
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  8. #8
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    I don't want to confuse you further...

    Let's say you are installing this in a directory called '/cms'. This is what I would try:
    Code:
    #
    # URL rewriting for Etomite CMS
    # Copyright AAB '04
    #
    # To use friendly URLs for Etomite you need to uncomment the three Rewrite directives
    # Make sure RewriteBase points to the directory where you installed Etomite
    # e.g. / if your installation is in root
    # or /Etomite if your installation is in the Etomite subdirectory
    #
    #
    # You must be running on Apache with mod_rewrite to be able to use this functionality.
    #
    
    RewriteEngine On
    RewriteBase /cms
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    
    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
    And, I would put this file in the '/cms' directory.
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  9. #9
    JPC Addict lloyd_borrett's Avatar
    Join Date
    May 2004
    Location
    Melbourne, Australia
    Posts
    132
    I am running Etomite in the root directory.

    I only have two .htaccess files, that I am aware of. The one described here is in the root directory, and another different one is in the manager directory.

    Eventually I'm going to want to have a number of domain names pointing to this site with the same content being served up to them all. Right now the domain name I used to register with JaguarPC is still pointing elsewhere while I set this new web site up. Thus the current URL I'm using to access the web site is http://gold.nocdirect.com/~jequusco/. Maybe that has something to do with it?

    I've tried the main .htaccess file with the php lines in and out. Makes no difference.

    I've tried it with no RewriteBase line, plus with values like "/", "/public_html/" and "/~jequusco/" all without success.

    I just read in a forum on the Etomite web site the following as a fix for someone who was also in a hosted situation and having problems:

    Can you check your apache config file to see if AllowOverride is set to All? This will be in the main apache config (usually at /etc/httpd/httpd.conf) or in the virtual host configuration (which may be in the same file, or may be in an included file). If you're AllowOverride is set to None, no amount of tweaking a .htaccess file will help you.
    But I guess that is something I'll need to get the JaguarPC guys to check. And it might have nothing to do with my situation.

    Best Regards, Lloyd.

  10. #10
    the Windlord Gwaihir's Avatar
    Join Date
    Jun 2002
    Posts
    2,562
    Quote Originally Posted by lloyd_borrett
    A feature of Etomite is that it supports user/search engine friendly URLs via .htaccess and Mod-Rewrite.
    I that is their statement, then I would assume their software writes these rules for you - otherwise I would hardly call it a supported feature.

    So I'd suggest to start by making your .htaccess overwritable by the server and install the thing according to the instructions that come with it. Fair chance it already makes all the rewrite rules for you.
    Regards,

    Wim Heemskerk
    ---
    Visit MeCCG.net - Cardgaming in J.R.R. Tolkien's Middle-earth
    And Gwaihir.net - The Middle-earth CCG store

  11. #11
    || $name ne 'R.Stiltskin'
    Join Date
    Jun 2003
    Location
    Tejas
    Posts
    2,438
    Lloyd,

    I'm 99.9% certain that you have all you need to get your app going. AllowOverride will be enabled. You almost certainly have mod-rewrite available. You have enabled it properly with the "on" switch. At some point we may send you a quick rewrite rule to test your install but I'd rather not introduce this beast yet so that we don't introduce new points of failure.

    The problem most likely is the RewriteBase1 | RewriteBase2 line and its implementation on a virtual (shared) server. In the shared server configuration portion of httpd.conf, under your account, an "alias directive" will likely exist that associates a physical path with a virtual one to your webspace:

    Alias /xyz /abc/def

    This means "assign any request for the virtual server path '/xyz' to the real, physical path of '/abc/def'".

    Or, more specifically,
    Alias /virtualhomes/public_web_root /realserverroot/physical/path/to/same/public_web_root

    Now with virtual hosting, some of this will be setup using <VirtualHost *>SharedHost SomeData</VirtualHost> and I'm not privy to the configurations. There may be some stuff in there assigning some paths that might require tech support... but I doubt it. This is just some background to help you understand the backend use of real and virtual paths for shared servers.

    Now for your application:
    Code:
    # from instructions, for http://yourserver/~yourEtomiteSite
    # if installed in public root
    RewriteBase /yourEtomiteSite/
    
    # So it follows that an install into public
    # for http://gold.nocdirect.com/~jequusco
    RewriteBase /~jequusco/
    
    # would seem proper;
    # unfortunately, you've tried this and it failed
    What I would probably try is changing the path like you have already done, but go higher up your account directory when you start. For example and alternately trying the following:
    Code:
    RewriteBase /yourhome/youraccount/yourpublic_html/yourEtomiteinstall/
    # or next
    RewriteBase /yourhome/youraccount/yourpublic_html/
    # or next
    RewriteBase /yourhome/youraccount/
    # or ...
    If you need more explicit instruction, I'll PM you since I don't want to expose such explicit information to the wrong eyes. I think you'll be able to figure out what I've described when you look at your account hierarchy. This is no guarantee but worth a shot. Vin's instruction seemed proper to me but the CMS guide could use some rewording for clarity. They should include a guide for those setting up a dedicated webserver and those running a shared server.

    Good luck.
    Last edited by Spathiphyllum; 06-07-2005 at 07:36 AM. Reason: Rewrote "RewriteBase"

  12. #12
    the Windlord Gwaihir's Avatar
    Join Date
    Jun 2002
    Posts
    2,562
    Quote Originally Posted by Vin DSL
    Personally, I'd get rid of that compression jazz. That's just asking for trouble...
    Hmm.. compression has its uses, but if you're enabling it that "globally" from your .htaccess, I think you'd better use mod_gzip instead. It's faster and won't clash with scripts that use output buffering, which your current setting can do.

    Quote Originally Posted by Spathiphyllum
    AllowOverride will be enabled. You almost certainly have mod-rewrite available.
    If you have doubts about the first, support can check that easily. The second you can see for yourself using phpinfo().
    Last edited by Gwaihir; 09-18-2005 at 10:03 AM.
    Regards,

    Wim Heemskerk
    ---
    Visit MeCCG.net - Cardgaming in J.R.R. Tolkien's Middle-earth
    And Gwaihir.net - The Middle-earth CCG store

  13. #13
    JPC Addict lloyd_borrett's Avatar
    Join Date
    May 2004
    Location
    Melbourne, Australia
    Posts
    132
    It's working!!!

    I tried
    Code:
    RewriteBase /~jequusco/
    and it worked, with and without the PHP lines enabled. Maybe I only tried
    Code:
    RewriteBase /jequusco/
    yesterday. I know I tried an awful lot of combinations.

    Thanks to all that helped to steer me in the write direction.

    Best Regards, Lloyd Borrett.

  14. #14
    || $name ne 'R.Stiltskin'
    Join Date
    Jun 2003
    Location
    Tejas
    Posts
    2,438
    Quote Originally Posted by lloyd_borrett
    Thanks to all that helped to steer me in the write direction.
    Are you sure that's not the mod-rewrite direction?

    Anyhoo, congrats.

  15. #15
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    Quote Originally Posted by Gwaihir
    Hmm.. compression has its uses...
    Don't take me wrong...

    http://www.pipeboost.com/GetReport.a...lenon .com%2F

    http://leknor.com/code/gziped.php?ur...lenon.co m%2F

    I just don't like the way they were TRYING to implement it in the example.
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •