We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22629
    • 194 Posts
    Quote from: OpenGeek at Mar 03, 2006, 11:08 PM

    Hello snowflip, it looks like you are using the friendly alias paths option, and in 0.9.1 we removed a forced fix for this from the core, making it necessary for you to add this to your templates if you structured your site in such a way as to require absolute links to get back to the root of the site. Try adding the following to the top of your HEAD element in your template( s ) and see if that solves the problem:

    <base href="[(site_url)]" />


    Let me know if that doesn’t help.


    This doesn’t work in IE7 - IE7 doesn’t appear to support the <base href> tag shocked (firefox 2 works just fine)

    Where is the best place in the ModX code to force a prefix to be added to each link created? (i.e. can I have the pre-0.9.1 force-absolute fix back!)
    (take, for example, this link: http://www.andyshellam.eu/site_v61/links/site-nav/journal
    when you go to the above page in IE7 the links come out to http://www.andyshellam.eu/site_v61/links/site-nav/links/site-nav/journal.

    How can I force modX to add /site_v61/ to the beginning of each link (my modX root)?

    I know IE7 is still only in Beta, but there are plenty of people I know using it (and Micro$oft intend to ship this out via Windows update to upgrade IE6 so plenty more will be when it gets released), so until it supports this tag, I’d like to get this work-around back in place!

    Thanks!
      Andy Shellam | www.networkmail.eu | @Pandy06269 @NetworkMail

      modx Revolution 2.2.6
      Windows 2012 | IIS 8 | php 5.4.11 | MySQL 5.5.29

      Content-Managed Websites Built on MODX
      • 22303 MODX Staff
      • 10,725 Posts
      I think you are confused a little about the purpose of the base tag (which IE 7 supports fine, I just tested), and how friendly URLs work in a subdirectory.

      If you’re site is not in your web server document root (I couldn’t get to any of those URL’s BTW), you need to edit the .htaccess file accordingly, modifying the mod_rewrite rules to operate in the sub-directory location where modx is installed. This has nothing to do with the Friendly Alias Paths option, which when enabled, requires the base tag to help manage the virtual directory levels being represented by the hierarchy of MODx documents in your site, but this only applies to URL’s affected by the mod_rewrite rules in your .htaccess, which in your case should only be within /site_v61/.
        • 22629
        • 194 Posts
        Jason,

        I think you’ve mis-understood me somewhere. I have had networking problems over the last few days explaining the loss of my site.

        Here’s the snippet of my .htaccess which handles re-writing:

        RewriteEngine On
        
        RewriteBase /site_v61/
        
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        
        # If your MODx installation is in a subdirectory, change the following line to m atch the physical
        # path to the "root" of the site as follows:
        # RewriteRule ^(.*)$ /path/to/subdirectory/index.php?q=$1 [L,QSA]
        
        RewriteRule ^(.*)$ /site_v61/index.php?q=$1 [L,QSA]


        This isn’t a problem, and as I stated, works fine in Firefox 1.5 and 2.0.

        In Firefox (or IE6), if you go to http://www.andyshellam.eu/site_v61/links/site-nav/journal, then move your mouse over the links in the yellow links bar (e.g. "Who Am I?", "Articles" etc) you’ll notice you get links like http://www.andyshellam.eu/site_v61/links/site-nav/about, http://www.andyshellam.eu/site_v61/links/site-nav/articles.

        Perfect - that’s what I want.

        Go to the same page in IE7 and it’s a different story. The same two links (about, articles) appear as:
        http://www.andyshellam.eu/site_v61/links/site-nav/links/site-nav/about
        http://www.andyshellam.eu/site_v61/links/site-nav/links/site-nav/articles

        So clearly IE7 is not taking notice of the BASE HREF tag which is "<base href="http://www.andyshellam.eu/site_v61/" />", right underneath <BODY>.

        The links appear in the source as "links/site-nav/about". If I could prefix all links generated in ModX with "/site_v61/", IE7 would therefore see it as "/site_v61/links/site-nav/about" which would be correct.

        My IE7 version is Beta-3 (7.0.5450.4)
          Andy Shellam | www.networkmail.eu | @Pandy06269 @NetworkMail

          modx Revolution 2.2.6
          Windows 2012 | IIS 8 | php 5.4.11 | MySQL 5.5.29

          Content-Managed Websites Built on MODX
          • 10487 MODX Staff
          • 1,535 Posts
          So clearly IE7 is not taking notice of the BASE HREF tag which is "<base href="http://www.andyshellam.eu/site_v61/" />", right underneath <BODY>.
          You’re absolutely right - IE7 will now only recognise the <base> tag if placed in the HEAD of the document. wink - which, for once, IE is actually in line with the (X)HTML specifications.
            Garry Nutting
            Senior Developer
            MODX, LLC

            Email: [email protected]
            Twitter: @garryn
            Web: modx.com
            • 22629
            • 194 Posts
            Quote from: garryn at Aug 24, 2006, 06:39 AM

            So clearly IE7 is not taking notice of the BASE HREF tag which is "<base href="http://www.andyshellam.eu/site_v61/" />", right underneath <BODY>.
            You’re absolutely right - IE7 will now only recognise the <base> tag if placed in the HEAD of the document. wink - which, for once, IE is actually in line with the (X)HTML specifications.

            Thanks, I hadn’t realised BASE needs to be within HEAD.

            IE adhering to standards, whatever next? laugh
              Andy Shellam | www.networkmail.eu | @Pandy06269 @NetworkMail

              modx Revolution 2.2.6
              Windows 2012 | IIS 8 | php 5.4.11 | MySQL 5.5.29

              Content-Managed Websites Built on MODX