User Tools

Site Tools


htaccess_recipes

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
htaccess_recipes [2022/02/14 03:11] – [Save the current directory as an environment variable] jquahhtaccess_recipes [2022/02/14 03:16] – [Save the current directory as an environment variable] jquah
Line 46: Line 46:
 </code> </code>
  
-The # symbol serves as an arbitrary delimiter, ensuring that the second parenthesized group captures the working directory that's known to the server at the time of processing. Whether the working directory is an absolute pathname on the filesystem or an alias that will later be expanded by mod_userdir, the environment variable ''CWD'' will capture usable value for the subsequent RewriteRule.+The # symbol serves as an arbitrary delimiter, ensuring that the second parenthesized group captures the working directory that's known to the server at the time of processing. Whether the working directory is an absolute pathname on the filesystem or an alias that will later be expanded by mod_userdir, the environment variable ''CWD'' will have a value compatible with the order in which Apache processes UserDir and RewriteRule directives.
  
 This example can be extended to perform different redirections depending on which virtual host handled the transaction (just create a new stanza with a different condition on %{HTTP_HOST}). In this way you can give your visitors the same experience whether they've bookmarked your site as http://YOURUSERNAME.sdf.org or http://sdf.org/~YOURUSERNAME, without having to duplicate your content in multiple folders. This example can be extended to perform different redirections depending on which virtual host handled the transaction (just create a new stanza with a different condition on %{HTTP_HOST}). In this way you can give your visitors the same experience whether they've bookmarked your site as http://YOURUSERNAME.sdf.org or http://sdf.org/~YOURUSERNAME, without having to duplicate your content in multiple folders.
htaccess_recipes.txt · Last modified: 2022/08/01 20:35 by peteyboy