Sep 06, 2008, 01:37 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
modxcms.com web
  MODxCMS.com   Forums   Help Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Twice about root url  (Read 1687 times)
0 Members and 1 Guest are viewing this topic.
tillda
Testers
*
Posts: 89



WWW
« on: Jun 28, 2006, 10:33 PM »

1. How do I specify, that for the root document I do not want any alias, just a www.domain.com.

2. Is there some MODx tag/function, that would return the root url? For example, RFC says, that even in the simplest 301/302 redirection, it must be in the form of full valid URI, like 302 See Other : http://www.domain.com/some-modx-site, not just /some-modx-site, like is everywhere implemented. So when creating a snippet, I don't want to use just "302 See Other: [~id~]", I need the full URI with www. ... and directories, if presented.

Thanks a lot.
Logged

ram
Full Member
***
Posts: 135


1000000 MHz


WWW
« Reply #1 on: Jun 29, 2006, 09:51 AM »

I came into the same problem and it has also been mentioned in another thread
@
http://modxcms.com/forums/index.php/topic,5375.0.html

I ended up creating a small plugin which that listens to 'OnWebPagePrerender' and removes the alias/id (I left the start page named the default of '1') from the links to the start page and set it to point at the web root '/'.

Code:
$output = $modx->documentOutput;
$pattern = '/href=\"1\/\"/';
$replacement = 'href="/"';
$modx->documentOutput = preg_replace($pattern, $replacement, $output);
Logged

Lektriq - Cambridge UK-based Graphic Design & Web Development Studio
ChuckTrukk
Committed to MODx
*****
Posts: 541



WWW
« Reply #2 on: Jun 29, 2006, 01:52 PM »

That's a good tip ram.

Thanks
Logged

Chuck the Trukk
ProWebscape.com :: Nashville-WebDesign.com
- - - - - - - -
What are TV's? Here's some info below.
http://modxcms.com/forums/index.php/topic,21081.msg159009.html#msg1590091
http://modxcms.com/forums/index.php/topic,14957.msg97008.html#msg97008
tillda
Testers
*
Posts: 89



WWW
« Reply #3 on: Jun 29, 2006, 06:23 PM »

That's a good tip ram.

I'll probably take care of both in the SVN, becouse i need it NOW =)
Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP

Copyright © 2005-2008 MODxCMS, All rights reserved. Contact Us
Styles by ziworks.com

Powered by SMF 1.1.4 | SMF © 2005, Simple Machines LLC

Valid XHTML 1.0! Valid CSS!