We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10107
    • 24 Posts
    I’ve tried searching around but every example I tried made no difference.

    I have a site which is setup like this www.domain.com/~sitename/

    All I want to do is to remove the ~sitename from page requests, [[++site_url]] for instance puts this ~sitename back into urls so internal weblinks are broken, well not totally broken, they work but I need to just remove that ~sitename. Also in the manager anything with a ~ in the address bar breaks phpthumb so my client can’t see the thumbnails.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      From my understanding of .htaccess, you won’t be able to do it that way; you need to reverse your approach. Pages need to actually be requested with the ~sitename part, since that is how Apache can find the pages. So the .htaccess would be used to add /~sitename to all page requests. Removing it from all links and URLs would be the job of MODx, just as friendly URLs is handled internally by MODx (and the .htaccess converts the URL to the expected index.php?... URL). I would just use a plugin to remove it before rendering the page. (in Evo, that would use the onPagePrerender event).
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 10107
        • 24 Posts
        Quote from: sottwell at Nov 24, 2010, 12:04 AM

        From my understanding of .htaccess, you won’t be able to do it that way; you need to reverse your approach. Pages need to actually be requested with the ~sitename part, since that is how Apache can find the pages. So the .htaccess would be used to add /~sitename to all page requests. Removing it from all links and URLs would be the job of MODx, just as friendly URLs is handled internally by MODx (and the .htaccess converts the URL to the expected index.php?... URL). I would just use a plugin to remove it before rendering the page. (in Evo, that would use the onPagePrerender event).

        Thanks for the reply, I didn’t realise that in my config file the paths had been changed to /~username/ I removed them and it works perfectly now. I’m an idiot.