We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 31902
    • 342 Posts
    Hi there...hopefully an easy one.

    I have a blog site, which I created using the blog tutorial located here:

    http://rtfm.modx.com/display/revolution20/Creating+a+Blog+in+MODx+Revolution


    All’s working fine and it’s now time to get the site to show pages as URL friendly. The problem is that most pages of the site are showing the URLs friendly (showing the entries I put in the Resource Alias field). The main pages are showing URLs fine...the blog pages are showing them fine...every page except the page that shows the listing of all articles. It still shows the URL as:

    http://www.domain.com/index.php?id=4

    Why would that be? I did the following:

    1. Set the .htaccess file to read:

    # Friendly URLs Part
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} .
    # Force all pages to go to www.domain.com for SEO
    RewriteCond %{HTTP_HOST} !^www\.domain\.com [NC]
    RewriteRule (.*) http://www.domain.com/$1 [R=301,L]
    # Friendly URLs
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
    # Additional Settings Follow
    ExpiresActive On
    ExpiresByType image/gif A2592000
    ExpiresByType image/jpeg A2592000
    ExpiresByType image/png A2592000
    BrowserMatch "MSIE" brokenvary=1
    BrowserMatch "Mozilla/4.[0-9]{2}" brokenvary=1
    BrowserMatch "Opera" !brokenvary
    SetEnvIf brokenvary 1 force-no-vary


    (yes, the ’domain’ in my actual .htaccess file is my actual domain) and uploaded to root.

    2. I’ve got this in the head:

    <base href="[[!++site_url]]" />


    3. In system settings, I have ’Use Friendly URLs’ checked. I did try the system with ’Check for Duplicate ULIs Across All Contexts’ and ’Use Friendly Alias Path’ both set to ’yes’ but no luck.

    4. Added my choice of URL friendly name in the Resource Alias field field.

    Anything I’m missing that you can see? Thank you in advance.

    Revo 2.1.3
    PHP Version 5.2.17
      • 33968
      • 863 Posts
      Can you access that page directly by typing in www.domain.com/friendly-alias ?
        • 31902
        • 342 Posts
        Oh, silly, silly me. I goofed on this one.

        First, to answer your question, yes, I can. I can also see the right friendly URL if I view the page by way of the view button in the control panel.

        What happened was that the link I was using to get to the page, that was showing wrong, was hard-coded as index.php?id=4. Sometimes, I just feel so dumb.

        Thank you for responding, though.
          • 33968
          • 863 Posts
          Heh, don’t worry we’ve all been there before... I thought it might have had something to do with your link tongue
            • 31902
            • 342 Posts
            Hopefully this will help someone out there:

            As a weird coincidence, I had the same problem happen again on a different project today. The difference is that on this other site, the link was not stupidly hard-coded into the template, like my earlier example. No, this was a site that was supposedly working okay otherwise.

            Long story short, after looking for almost an hour at my system and not finding anything wrong, I eventually found that the client had decided to move some menu items around. That’s good, but instead of dragging a resource from one place to another and letting Wayfinder handle the menu details, she kept the resource where it was, hid it from appearing on the menu and placed a weblink in the new location instead.

            As you might imagine, the weblink contained the non-user friendly address, hard-coded into it. ARGH!

            I think the universe is trying to teach me something I haven’t learned yet because this seems to be a theme with my projects this week.

            Anyway, if anyone runs into a similar situation, this might be a place for you to look within your project.