Friday 24 March 2006 7:21:23 am
Not bad, Roy, that PathPrefix is a sweet thing. What I did was go to my site.ini override and make sure to add this:
[SiteAccessSettings]
PathPrefix=mysite_com
What this does is transform all URL's so that <b>/index.php/mysite_com/page/</b> is no longer valid, but instead <b>/index.php/page</b> is. Even better, all URL's generate by <link> or <a> tags inside XML blocks are by default affected by this and are generated directly in the form <b>/index.php/page</b>, which is very nice. Still, you have "index.php" in both the XML block generated links and in the URL's. To get rid of the "index.php" in the URL one can use the mod_rewrite rules above, but slightly changed:
RewriteCond %{HTTP_HOST} ^(www\.)?mysite\.com$ [NC]
RewriteCond %{REQUEST_URI} !^/index\.php/ [NC]
RewriteCond %{REQUEST_URI} !^/design/ [NC]
RewriteCond %{REQUEST_URI} !^/var/ [NC]
RewriteRule ^(.*)$ /index\.php/$1 [L]
However, messing with the way XML object generates internal links is a bit more tricky. What you do is go in the admin interface to Design/Templates, browse until you come across <b>/content/datatype/view/ezxmltags/link.tpl</b> and you create a new override, let's call it link_stripped.tpl. Use a copy of the original, not an empty file. (And take care to create the override for the siteaccess you have business with!) Next, you go edit the file (found under design/mysite_com/override/templates/link_stripped.tpl. You edit it and replace the <b>{$href|ezurl}</b> part with <b>{$href|ezroot}</b> and that's it, now generated links only contain the /page part!
|