on 12/3/03 8:14 pm, Christophe Pettus at [EMAIL PROTECTED] wrote: > Now, b and c don't really exist as directories and files. Instead, > what I want is the default file in webroot/a (default.a4d or > whatever) to be invoked, and it will take apart the URL and return > the appropriate resource. Besides hacking up the shell, is there a > straight-forward way of doing this?
That all depends on what you're using as a webserver. We do this all the time using Apache. For example, if you check out the standingwave website, you'll notice that the pages don't have any extensions or anything. This is because the whole site is actually delivered from one PHP page which grabs the content from XML files and dynamically produces the pages using a few templates. The rewrite rule in apache converts the URL received by the webserver into the dynamic page URL, e.g. http://www.standingwave.co.uk/eng/hosting/4d ...becomes... http://www.standingwave.co.uk/dynamicpage.php?lang=eng&path=hosting/4d You can even just load the page using the 2nd URL. The rewrite rule we use for this is as follows... RewriteRule ^/([a-z]{3})/(.*)$ /dynamicpage.php?lang=$1\&path=$2 So, if you're using something like Apache as your webserver (there's also a rewriter available for Webstar and IIS), you can rewrite the URLs at this stage. As far as the browser is concerned, they're seeing the URL you want them to see, but 4D/A4D will get what you wanted. You can add lots of rewrite rules which match various URL combinations. We've successfully used this technique on quite a few sites. For more information and examples of what you can do with URL rewriting, check out... http://httpd.apache.org/docs/misc/rewriteguide.html Best, Mark -- Mark Mitchenall StandingWave Ltd `Complete 4D Web Hosting Solutions Direct := +44 (0)20 8452 3031 Mobile := +44 (0)7850 847 543 Email := [EMAIL PROTECTED] Home: := http://www.standingwave.co.uk/
