<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<channel>
	  <title>Ask MetaFilter questions tagged with htaccess</title>
      <link>http://ask.metafilter.com/tags/htaccess</link>
      <description>Questions tagged with 'htaccess' at Ask MetaFilter.</description>
	  <pubDate>Mon, 14 Dec 2009 12:30:09 -0800</pubDate> <lastBuildDate>Mon, 14 Dec 2009 12:30:09 -0800</lastBuildDate>

      <language>en-us</language>
	  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
	  <ttl>60</ttl>	  
	<item>
	<title>.htaccess or some other solution for altering a url across a domain?</title>
	<link>http://ask.metafilter.com/140657/htaccess%2Dor%2Dsome%2Dother%2Dsolution%2Dfor%2Daltering%2Da%2Durl%2Dacross%2Da%2Ddomain</link>	
	<description> I use a CMS which needs domain.com/index.php/template/filename in order to work. I used to have an htaccess file which would make domain.com/template/filename work fine (ie, it would load the correct page even without the index.php there). Dreamhost recently upgraded its software and the htaccess file no longer works. Is there a solution for this problem? Note that I know nothing about htaccess. I got this file years ago off of a web forum, but it worked so I never question it. Here&apos;s what the htaccess file had in it (I changed the greater and lesser thans to square brackets because AskMe wasn&apos;t displaying them properly):&lt;br&gt;
&lt;code&gt;&lt;br&gt;
[IfModule mod_rewrite.c]&lt;br&gt;
RewriteEngine On&lt;br&gt;
RewriteBase /&lt;br&gt;
RewriteCond %{REQUEST_URI} ^/stats/(.*)$ [OR]&lt;br&gt;
RewriteCond %{REQUEST_URI} ^/failed_auth.html$&lt;br&gt;
RewriteRule ^.*$ - [L]&lt;br&gt;
[/IfModule] &lt;br&gt;
&lt;br&gt;
[Files index.php]&lt;br&gt;
SetHandler application/x-httpd-php&lt;br&gt;
[/Files]&lt;br&gt;
&lt;br&gt;
RewriteEngine On&lt;br&gt;
RewriteBase /&lt;br&gt;
RewriteCond %{REQUEST_FILENAME} !-f&lt;br&gt;
RewriteCond %{REQUEST_FILENAME} !-d&lt;br&gt;
RewriteRule ^(.*)$ /index.php/$1 [L]&lt;br&gt;
&lt;br&gt;
AddHandler application/x-httpd-php .php &lt;/code&gt;&lt;br&gt;
&lt;br&gt;
Thank you.</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2009:site.140657</guid>
	<pubDate>Mon, 14 Dec 2009 12:30:09 -0800</pubDate>
	<category>coding</category>
	<category>htaccess</category>
	<category>html</category>
	<category>server</category>
	<category>webdeisgn</category>
	<dc:creator>You Should See the Other Guy</dc:creator>
	</item>
	<item>
	<title>Restricting access to directory... with conditions</title>
	<link>http://ask.metafilter.com/134705/Restricting%2Daccess%2Dto%2Ddirectory%2Dwith%2Dconditions</link>	
	<description>How do I restrict access to a directory on my web site but still allow an audio streamer program to access the files? For instance, I want to put my mp3s in the &lt;strong&gt;audio&lt;/strong&gt; directory but I want anyone going to &lt;strong&gt;mydomain.com/audio&lt;/strong&gt; to not be able to download the tracks. The audio player being used is &lt;a href=&quot;http://www.longtailvideo.com/players/jw-flv-player/&quot;&gt;JW Player&lt;/a&gt; if that makes any difference. Thanks!</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2009:site.134705</guid>
	<pubDate>Mon, 05 Oct 2009 18:35:15 -0800</pubDate>
	<category>audio</category>
	<category>directoryrestriction</category>
	<category>htaccess</category>
	<category>webdevelopment</category>
	<dc:creator>You Should See the Other Guy</dc:creator>
	</item>
	<item>
	<title>CIDR IP Range Calculator</title>
	<link>http://ask.metafilter.com/131173/CIDR%2DIP%2DRange%2DCalculator</link>	
	<description>Is there a CIDR IP address calculator that can do what I want? If I enter an arbitrary beginning IP address and an ending IP address, it should then give me a list of CIDR-ified IP ranges. Lets say I have to authorize an arbitrary range of IP addresses in an .htaccess file. The list looks like XXX.XXX.XXX.97 - XXX.XXX.XXX.255.&lt;br&gt;
&lt;br&gt;
I could just set the whole class C range like so, XXX.XXX.XXX.0/24, but that includes IP addresses that should not have access.&lt;br&gt;
&lt;br&gt;
The most compact way to display this is as such:&lt;br&gt;
XXX.XXX.XXX.197&lt;br&gt;
XXX.XXX.XXX.198/31&lt;br&gt;
XXX.XXX.XXX.100/30&lt;br&gt;
XXX.XXX.XXX.104/29&lt;br&gt;
XXX.XXX.XXX.112/28&lt;br&gt;
XXX.XXX.XXX.128/25&lt;br&gt;
&lt;br&gt;
I can do it with my brain but a tool to help speed this up would be great. Anybody know of one?</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2009:site.131173</guid>
	<pubDate>Wed, 26 Aug 2009 07:25:18 -0800</pubDate>
	<category>cidr</category>
	<category>htaccess</category>
	<category>ipaddress</category>
	<dc:creator>chillmost</dc:creator>
	</item>
	<item>
	<title>Can you help me with a mod_rewrite problem...?</title>
	<link>http://ask.metafilter.com/126868/Can%2Dyou%2Dhelp%2Dme%2Dwith%2Da%2Dmodrewrite%2Dproblem</link>	
	<description>Can you help me with a mod_rewrite problem...? I have two servers with copies of the same code on them. Lets call them www.example.com and test.example.com&lt;br&gt;
&lt;br&gt;
on www.example.com the files are in the directory /var/www/html/thesite&lt;br&gt;
&lt;br&gt;
on test.example.com the files are in the directory /var/www/html/stupidteststructure/anotherdir/thesite_test&lt;br&gt;
&lt;br&gt;
Sadly, I can&apos;t do anything about this.&lt;br&gt;
&lt;br&gt;
Now, on the test server I have the following .htaccess file in the &lt;code&gt;/stupidteststructure/thesite_test&lt;/code&gt; directory...&lt;br&gt;
&lt;pre&gt;&lt;br&gt;
RewriteRule ^$                        /stupidteststructure/thesite_test/content/  [R]&lt;br&gt;
RewriteRule ^content$                 /stupidteststructure/thesite_test/content/  [R]&lt;br&gt;
RewriteRule ^content/$                /stupidteststructure/thesite_test/process.php?page_alias=index  [L,QSA]&lt;br&gt;
RewriteRule ^content/(.*?)([/]*)$     /stupidteststructure/thesite_test/process.php?page_alias=$1  [L,QSA]&lt;br&gt;
&lt;/pre&gt;&lt;br&gt;
&lt;br&gt;
It could probably be improved, but it works and everyone is happy.&lt;br&gt;
&lt;br&gt;
Now, the problem is, when the code is copied to the live server, including the htaccess file, it all breaks because /stupidteststructure/thesite_test doesn&apos;t exist on that machine.&lt;br&gt;
&lt;br&gt;
Is there a good simple way to make this more generic, or am I going to have to add conditional rewrites for the two servers?&lt;br&gt;
&lt;br&gt;
I&apos;m hoping there is something simple like the following, where RTTD is some super sekrit &quot;Relative to this directory&quot; flag...&lt;br&gt;
&lt;br&gt;
&lt;pre&gt;&lt;br&gt;
RewriteRule ^$                        content/  [RTTD,R]&lt;br&gt;
RewriteRule ^content$                 content/  [RTTD,R]&lt;br&gt;
RewriteRule ^content/$                process.php?page_alias=index  [RTTD,L,QSA]&lt;br&gt;
RewriteRule ^content/(.*?)([/]*)$     process.php?page_alias=$1  [RTTD,L,QSA]&lt;br&gt;
&lt;/pre&gt;&lt;br&gt;
&lt;br&gt;
Help? I&apos;m supposed to have gone home half an hour ago... :)</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2009:site.126868</guid>
	<pubDate>Wed, 08 Jul 2009 09:33:28 -0800</pubDate>
	<category>htaccess</category>
	<category>Ihatemodrewrite</category>
	<category>mod_rewrite</category>
	<category>modrewrite</category>
	<dc:creator>twine42</dc:creator>
	</item>
	<item>
	<title>Why did my Wordpress .htaccess file change or become corrupt?</title>
	<link>http://ask.metafilter.com/126708/Why%2Ddid%2Dmy%2DWordpress%2Dhtaccess%2Dfile%2Dchange%2Dor%2Dbecome%2Dcorrupt</link>	
	<description>I have a Wordpress blog (v2.8) that sudden started displaying an Internal Server Error message.  My host (Dreamhost) found a problem with my .htaccess file.  I didn&apos;t do anything to cause the problem so I am wondering what happened and if it could happen again.   

I &quot;fixed&quot; it by replacing it with one that does nothing.  I am also wondering what the file should contain.  I know what its purpose is, but not much more than that. Here&apos;s the broken file:&lt;br&gt;
&lt;br&gt;
&lt;em&gt;# BEGIN WordPress&lt;br&gt;
&lt;br&gt;
# END WordPress&lt;br&gt;
ne On&lt;br&gt;
RewriteBase /&lt;br&gt;
RewriteCond %{REQUEST_FILENAME} !-f&lt;br&gt;
RewriteCond %{REQUEST_FILENAME} !-d&lt;br&gt;
RewriteRule . /index.php [L]&lt;br&gt;
&lt;br&gt;
# BEGIN WordPress&lt;/em&gt;&lt;br&gt;
&lt;br&gt;
# END WordPress&lt;br&gt;
&lt;br&gt;
I suspect that the 4th line should say &quot;Rewrite Engine On&quot;.  &lt;br&gt;
&lt;br&gt;
I do have a fair number of active plug-ins, but the configuration has been stable for awhile.</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2009:site.126708</guid>
	<pubDate>Mon, 06 Jul 2009 15:02:15 -0800</pubDate>
	<category>htaccess</category>
	<category>InternalServerError</category>
	<category>wordpress</category>
	<dc:creator>14580</dc:creator>
	</item>
	<item>
	<title>How can I rewrite the image paths on my web server?</title>
	<link>http://ask.metafilter.com/122748/How%2Dcan%2DI%2Drewrite%2Dthe%2Dimage%2Dpaths%2Don%2Dmy%2Dweb%2Dserver</link>	
	<description>How can I rewrite the image paths on my web server? I recently moved a site into a CMS and different web server. The images are in directories like this:&lt;br&gt;
/daily/2009/05/&lt;br&gt;
&lt;br&gt;
The web pages sometimes link to images like this:&lt;br&gt;
[img src=&quot;/daily/2009/05/&quot;]&lt;br&gt;
And sometimes they link to images like this (without a leading slash):&lt;br&gt;
[img src=&quot;daily/2009/05/&quot;]&lt;br&gt;
&lt;br&gt;
That worked fine on the old server, but the paths are different in the CMS on the new server. Can I use .htaccess or something to rewrite the paths?</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2009:site.122748</guid>
	<pubDate>Thu, 21 May 2009 17:09:12 -0800</pubDate>
	<category>htaccess</category>
	<category>image</category>
	<category>paths</category>
	<category>rewrite</category>
	<category>server</category>
	<category>web</category>
	<dc:creator>kirkaracha</dc:creator>
	</item>
	<item>
	<title>How do I redirect subfolder URLs to subdomain URLs?</title>
	<link>http://ask.metafilter.com/117076/How%2Ddo%2DI%2Dredirect%2Dsubfolder%2DURLs%2Dto%2Dsubdomain%2DURLs</link>	
	<description>Apologies for asking a question that I know will be answered already on the web, somewhere, but I can&apos;t find it. I&apos;m having trouble writing a .htaccess ReWrite rule that will forward requests for all folders within a specific sub-folder to the same folders at a subdomain - so http://www.mydomain.com/hello/foo/bar/ will forward to http://hello.mydomain.com/foo/bar/

Any advice very gratefully received.</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2009:site.117076</guid>
	<pubDate>Wed, 18 Mar 2009 11:37:58 -0800</pubDate>
	<category>htaccess</category>
	<category>redirect</category>
	<category>rewrite</category>
	<dc:creator>Cobbler</dc:creator>
	</item>
	<item>
	<title>PHP and htaccess question</title>
	<link>http://ask.metafilter.com/116957/PHP%2Dand%2Dhtaccess%2Dquestion</link>	
	<description>I use .htaccess files to allow users access to files in certain directories based on their IP addresses/ranges. They are linked to these file from a page (not within the htaccess protected directory) generated in PHP. Is there a way to display a variable on this PHP page based on whether or not the user will be allowed access into .htaccess protected directories? Ideally, if their IP address or range (CIDR) is in the htaccess file, they will be able to clink on the link and view the restricted files without any problems. If they don&apos;t have access, a link saying &quot;Need to purchase this file?&quot; will appear to the user. &lt;br&gt;
&lt;br&gt;
Is this possible? I tried to google this but I am coming up short. Perhaps I am not using the best search criteria. Is there possibly a certain term for what I&apos;m trying to do?&lt;br&gt;
&lt;br&gt;
Are there any other similar solutions that would achieve the same result but I&apos;m not aware of? A normal username/login system wouldn&apos;t work because some of the users come from institutions (Universities, libraries) where it is just much more easier to grant access via IP addresses.</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2009:site.116957</guid>
	<pubDate>Tue, 17 Mar 2009 05:58:50 -0800</pubDate>
	<category>access</category>
	<category>htaccess</category>
	<category>php</category>
	<category>programming</category>
	<dc:creator>chillmost</dc:creator>
	</item>
	<item>
	<title>Redirect question, with a sweet twist.</title>
	<link>http://ask.metafilter.com/115762/Redirect%2Dquestion%2Dwith%2Da%2Dsweet%2Dtwist</link>	
	<description>I&apos;m moving Wordpress from www.mydomain.com to www.mydomain.com/blog, but I&apos;m also putting in something new at root that I want people to see. Please .htaccess my brains out. I would like to move my Wordpress installation from www.mydomain.com to www.mydomain.com/blog, so I can put a sweet &lt;a href=&quot;http://sweetcron.com/&quot;&gt;Sweetcron&lt;/a&gt; installation at root. After I move Wordpress, I want to make sure that all my pages map to their new URLS. For example, http://www.mydomain.com/2009/03/03/sample-post/ needs to go to http://www.mydomain.com&lt;strong&gt;/blog&lt;/strong&gt;/2009/03/03/sample-post/ &lt;br&gt;
&lt;br&gt;
But! Since I&apos;ll have a new page at root, I do not want www.mydomain.com to redirect to www.mydomain.com/blog. I want people who land at www.mydomain.com/index.php to stay right where they are. I&apos;ve tried tutorials, video tutorials, and htaccess generators, but nothing seems to work. &lt;a href=&quot;http://ask.metafilter.com/107977/What-are-best-practices-for-changing-the-directory-of-a-Wordpress-blog&quot;&gt;This&lt;/a&gt; question doesn&apos;t cover it either. I know there&apos;s a combination of rules out there for me. Thanks in advance.</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2009:site.115762</guid>
	<pubDate>Tue, 03 Mar 2009 22:13:06 -0800</pubDate>
	<category>htaccess</category>
	<category>redirect</category>
	<category>resolved</category>
	<category>wordpress</category>
	<dc:creator>miniminimarket</dc:creator>
	</item>
	<item>
	<title>My redirect regex doesn&apos;t work. How can I fix it?</title>
	<link>http://ask.metafilter.com/113228/My%2Dredirect%2Dregex%2Ddoesnt%2Dwork%2DHow%2Dcan%2DI%2Dfix%2Dit</link>	
	<description>My redirect regex doesn&apos;t work. How can I fix it? I need to redirect this URL:&lt;br&gt;
http://pub.ucsf.edu/azlist/cache/index/submit_submit__searchtype_alpha__letter_Q.html&lt;br&gt;
to this one:&lt;br&gt;
http://www.ucsf.edu/azlist/sites/q/&lt;br&gt;
&lt;br&gt;
In English, I want the old A-Z list page for Q to direct to the new A-Z list page for Q (and the same for the other letters of the alphabet).&lt;br&gt;
&lt;br&gt;
I have this in my .htaccess in the azlist directory:&lt;br&gt;
&lt;br&gt;
&lt;code&gt;RewriteEngine on&lt;br&gt;
RewriteRule ^/azlist/cache/index/submit_submit__searchtype_alpha__letter_[A-Za-z]{1}\.html&lt;br&gt;
$ http://www.ucsf.edu/azlist/sites/$1/  [R=Permanent]&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
What I&apos;m expecting to happen: either a redirect or a scary server error.&lt;br&gt;
What happens instead: nothin&apos;.&lt;br&gt;
&lt;br&gt;
What am I doing wrong? Bonus question: how can I make the letter lowercase in the redirect?&lt;br&gt;
&lt;br&gt;
Apple web server running Darwin with Linux/Apache 2.2.8.</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2009:site.113228</guid>
	<pubDate>Mon, 02 Feb 2009 16:23:51 -0800</pubDate>
	<category>htaccess</category>
	<category>redirect</category>
	<category>regex</category>
	<dc:creator>kirkaracha</dc:creator>
	</item>
	<item>
	<title>Can I use htaccess to deny certain non-existent directories to avoid going through my Drupal site?</title>
	<link>http://ask.metafilter.com/110599/Can%2DI%2Duse%2Dhtaccess%2Dto%2Ddeny%2Dcertain%2Dnonexistent%2Ddirectories%2Dto%2Davoid%2Dgoing%2Dthrough%2Dmy%2DDrupal%2Dsite</link>	
	<description>Can I use htaccess to deny certain non-existent directories in order to avoid going through my Drupal site (which requires connecting to my database)? My Drupal site was hacked, though my content was not touched (which is why it went unnoticed for a while).  I eventually noticed and cleaned up several extra directories that had had thousands of subdirectories with spammer linking content.  The whole site is fresh and fixed but now I am getting a huge amount of 404 errors from all over the world, with people trying to access these old spam directories.  In Drupal, each time this happens, the 404 page is generated and the 404 error is logged, which means accessing the database, which means my database is straining just to issue all of these 404 denials.&lt;br&gt;
&lt;br&gt;
I just want a simple apache 404 page instead (but only for these spammer urls!).&lt;br&gt;
&lt;br&gt;
The former pages and subdirectories were all contained within three base directories (I&apos;ll call them spam1, spam2, spam3), and so I would like to use htaccess to simply deny any request for (e.g.):&lt;br&gt;
&lt;br&gt;
mysite.com/spam1/&lt;br&gt;
mysite.com/spam1/item34/spam.php&lt;br&gt;
mysite.com/spam2/item23/item5/anotherspam.php&lt;br&gt;
...&lt;br&gt;
&lt;br&gt;
And any other permutation.&lt;br&gt;
&lt;br&gt;
I don&apos;t know how to do this when the directories don&apos;t actually exist.  That is, I can recreate an empty folder called &quot;spam1&quot; and deny mysite.com/spam1/ requests with Apache, but this wouldn&apos;t deny any of the thousands of subdirectories -- as I said, Drupal steps in and takes over the 404 duties when the directory does not exist.&lt;br&gt;
&lt;br&gt;
Is there some way to do the kind of denial I want, to pre-empt Drupal and the database connections?  I do not control the server so htaccess may be my most powerful option.&lt;br&gt;
&lt;br&gt;
(Otherwise, maybe I have to reconfigure Drupal in some way?)</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2009:site.110599</guid>
	<pubDate>Fri, 02 Jan 2009 12:12:00 -0800</pubDate>
	<category>drupal</category>
	<category>hacked</category>
	<category>htaccess</category>
	<category>resolved</category>
	<category>spammers</category>
	<dc:creator>kosmonaut</dc:creator>
	</item>
	<item>
	<title>Please help me redirect visitors to my blog, from a subdomain to a subdirectory...</title>
	<link>http://ask.metafilter.com/109605/Please%2Dhelp%2Dme%2Dredirect%2Dvisitors%2Dto%2Dmy%2Dblog%2Dfrom%2Da%2Dsubdomain%2Dto%2Da%2Dsubdirectory</link>	
	<description>I have a blog, which I did have available at blog.example.com. I have recently moved it to be a subdirectory of my main site www.example.com/blog. I am having some trouble with redirecting old links from the subdomain across the the new main site subdirectory, and I really need some help to get it working right. can someone help me craft a .htaccess file to handle the redirects?</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2008:site.109605</guid>
	<pubDate>Fri, 19 Dec 2008 07:48:57 -0800</pubDate>
	<category>apache</category>
	<category>htaccess</category>
	<category>linux</category>
	<category>wordpress</category>
	<dc:creator>Scramblejam</dc:creator>
	</item>
	<item>
	<title>Securing a Directory and Logging Logins</title>
	<link>http://ask.metafilter.com/108076/Securing%2Da%2DDirectory%2Dand%2DLogging%2DLogins</link>	
	<description>Need to password protect a directory on my site in a fashion that allows me to see which approved users are logging in, and when. I know .htaccess will let me do do the security and the separate accounts, but can I get a report on user activity? Or is there a better way? Obviously, a Google search returns plenty. So much, though, is from sites I&apos;m totally unfamiliar with - I&apos;m interested in advice from the community I trust.</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2008:site.108076</guid>
	<pubDate>Mon, 01 Dec 2008 07:50:48 -0800</pubDate>
	<category>htaccess</category>
	<category>html</category>
	<category>security</category>
	<category>www</category>
	<dc:creator>boombot</dc:creator>
	</item>
	<item>
	<title>What are best practices for changing the directory of a Wordpress blog?</title>
	<link>http://ask.metafilter.com/107977/What%2Dare%2Dbest%2Dpractices%2Dfor%2Dchanging%2Dthe%2Ddirectory%2Dof%2Da%2DWordpress%2Dblog</link>	
	<description>I want to move my Wordpress blog from a subdirectory on my domain to the root directory -- i.e., I want the URL of my posts to be changed from http://www.domain.com/blog/post-permalink to http://www.domain.com/permalink . What&apos;s the best way to ensure that external links don&apos;t die? Is there a way to make sure that individual posts will retain their Google PageRank? I know that some variation on a RewriteRule in the site&apos;s .htaccess file is what I&apos;m looking for, but I&apos;m unclear on the specifics. What are best practices for this sort of transition?</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2008:site.107977</guid>
	<pubDate>Sat, 29 Nov 2008 13:06:13 -0800</pubDate>
	<category>blog</category>
	<category>change</category>
	<category>htaccess</category>
	<category>php</category>
	<category>seo</category>
	<category>url</category>
	<category>wordpress</category>
	<dc:creator>tweebiscuit</dc:creator>
	</item>
	<item>
	<title>Restricting access to a symbolically-linked path using htaccess</title>
	<link>http://ask.metafilter.com/104202/Restricting%2Daccess%2Dto%2Da%2Dsymbolicallylinked%2Dpath%2Dusing%2Dhtaccess</link>	
	<description>Can I restrict access to a symbolically-linked path using htaccess? I have a Solaris file system that my Apache web server accesses through a symbolic link. I need to restrict access to those files to a select group of users. The rules for access are in a MySQL db, so I&apos;m thinking I can run a cron to regularly generate an htpasswd file. An htaccess file won&apos;t work on the remote file system (which isn&apos;t running apache), though, will it? Can I add something to my httpd.conf file which will make users authenticate before accessing content on the other side of that symlink?</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2008:site.104202</guid>
	<pubDate>Tue, 14 Oct 2008 07:13:25 -0800</pubDate>
	<category>apache</category>
	<category>htaccess</category>
	<category>solaris</category>
	<category>unix</category>
	<dc:creator>jpoulos</dc:creator>
	</item>
	<item>
	<title>two folders two domains one website</title>
	<link>http://ask.metafilter.com/103155/two%2Dfolders%2Dtwo%2Ddomains%2Done%2Dwebsite</link>	
	<description>Two domain names loading the same website - only the websites aren&apos;t being served from the same folder, despite the fact that they are served from the same server. There exist two folders: users on a Unix machine. How can I get both domain names to serve up the website from the same folder? And is there any reason I should NOT do this? I don&apos;t think there&apos;s a webmin...&lt;br&gt;
&lt;br&gt;
Thanks!</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2008:site.103155</guid>
	<pubDate>Wed, 01 Oct 2008 09:58:36 -0800</pubDate>
	<category>apache</category>
	<category>htaccess</category>
	<category>linux</category>
	<category>server</category>
	<category>webdesign</category>
	<dc:creator>dance</dc:creator>
	</item>
	<item>
	<title>Can I combine htaccess and session variables from other systems?</title>
	<link>http://ask.metafilter.com/97321/Can%2DI%2Dcombine%2Dhtaccess%2Dand%2Dsession%2Dvariables%2Dfrom%2Dother%2Dsystems</link>	
	<description>Web server question. Can I combine htaccess and session variables from other systems? (more inside) OK, bear with me here--I&apos;m a page developer, not a server admin. I&apos;ve got an apache system that uses htaccess and a .db file to grant access to particular directories. I&apos;ve also got a set of users who aren&apos;t in the .db file, but will be logging in to another system (salesforce.com) and trying to access those restricted areas. Is there a way to allow the first set of users to continue logging in as always, but to allow a session variable that is established on the salesforce.com site to be passed, allowing this second set of users to access the area without having to log in again?</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2008:site.97321</guid>
	<pubDate>Wed, 23 Jul 2008 10:03:34 -0800</pubDate>
	<category>apache</category>
	<category>authentication</category>
	<category>htaccess</category>
	<category>server</category>
	<category>session</category>
	<category>variables</category>
	<category>web</category>
	<dc:creator>jpoulos</dc:creator>
	</item>
	<item>
	<title>.htaccess files and groups</title>
	<link>http://ask.metafilter.com/96318/htaccess%2Dfiles%2Dand%2Dgroups</link>	
	<description>I&apos;m configuring some htaccess files for multiple directories and I&apos;m having some problems incorporating groups of authorized users. Say there&apos;s 4 directories with protected content in each: 2005, 2006, 2007, 2008&lt;br&gt;
&lt;br&gt;
The people that have access are subscribers. Some users have access to all directories, and some users have access only for some. Access is granted based on password or IP address/range.&lt;br&gt;
&lt;br&gt;
For this situation I have an .htaccess file similar this in each directory:&lt;br&gt;
&lt;br&gt;
&lt;pre&gt;AuthType Basic&lt;br&gt;AuthName &quot;2008 Subscriptions&quot;&lt;br&gt;AuthUserFile /path/to/password/file/2008.pw&lt;br&gt;require valid-user&lt;br&gt;Satisfy any&lt;br&gt;order deny,allow&lt;br&gt;allow from 123.123.123.123&lt;br&gt;allow from 223.223.223.223&lt;br&gt;allow from 123.156.0.0/16&lt;br&gt;and so on&lt;br&gt;and so on&lt;br&gt;and so on&lt;br&gt;deny from all&lt;/pre&gt;This works perfectly for the situation described above.&lt;br&gt;
&lt;br&gt;
The IP addresses in the .htaccess files and users in the password files are pretty static. Once they are in there, they usually stay. However, there is a small group of people, we&apos;ll call them editors, that is very dynamic. People are constantly being added to and removed from this list. These editors should have access to all 4 directories. Currently they are given access permission via the password file shown above. This means that if an editor is added or removed, I have to make the change in 4 different files. Sometimes they are accidentally not added or removed to all the lists and then they complain and somebody has to fix it with a lot of back and forth and yada yada.&lt;br&gt;
&lt;br&gt;
I want to set up a group just for the editors. I want to have just one list that I have to edit instead of 4 whenever a change is made.&lt;br&gt;
&lt;br&gt;
However, from what I find in my searching, the way to add groups is to add the line: &lt;pre&gt;AuthGroupFile /path/to/editors/file/.htgroup&lt;/pre&gt; and inside this file add something like:&lt;pre&gt;editors: john sally joe&lt;/pre&gt;&lt;br&gt;
&lt;br&gt;
My questions:&lt;br&gt;
How do I assign passwords to these users? &lt;br&gt;
&lt;br&gt;
Does this mean that in addition to maintaining this htgroup file, I need to assign and maintain another password file as well? &lt;br&gt;
-If so, that isn&apos;t what I want because I only want to have to edit ONE file for the editors, NOT TWO.&lt;br&gt;
&lt;br&gt;
Is this possible?&lt;br&gt;
Am I going about this the wrong way?</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2008:site.96318</guid>
	<pubDate>Fri, 11 Jul 2008 06:37:30 -0800</pubDate>
	<category>apache</category>
	<category>htaccess</category>
	<category>permissions</category>
	<category>server</category>
	<dc:creator>chillmost</dc:creator>
	</item>
	<item>
	<title>htaccess and description column</title>
	<link>http://ask.metafilter.com/96278/htaccess%2Dand%2Ddescription%2Dcolumn</link>	
	<description>I would like to use .htaccess to pull out a specific part of a filename and display it in the &quot;Description&quot; column of a file directory on an apache web server. All files in this directory are formatted like this:&lt;br&gt;
&lt;br&gt;
aaaaaaaa-bbbb-c~c-d~d.ext&lt;br&gt;
&lt;br&gt;
There is always a hypen between each block, and blocks &quot;a&quot; and &quot;b&quot; are always the same length. &quot;c&quot; and &quot;d&quot; are variable lengths, symbolized by the ~, but they always consist of alphanumeric characters.&lt;br&gt;
&lt;br&gt;
Ideally, I&apos;d like for the &quot;c&quot; block to be pulled out and displayed in the &quot;description&quot; column when users browse this directory. Also OK would be to display both &quot;c&quot; and &quot;d&quot; in the description, but just &quot;c&quot; would be perfect.&lt;br&gt;
&lt;br&gt;
My poor regex-fu combined with my lack of comprehensive understanding of htaccess goodness is keeping me from doing this successfully, assuming it can be done at all.</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2008:site.96278</guid>
	<pubDate>Thu, 10 Jul 2008 15:10:04 -0800</pubDate>
	<category>apache</category>
	<category>description</category>
	<category>directory</category>
	<category>file</category>
	<category>htaccess</category>
	<dc:creator>maxwelton</dc:creator>
	</item>
	<item>
	<title>Can you help me with .htaccess and 301 redirects?</title>
	<link>http://ask.metafilter.com/95542/Can%2Dyou%2Dhelp%2Dme%2Dwith%2Dhtaccess%2Dand%2D301%2Dredirects</link>	
	<description>I have a rewritecond which hands my seo friendly urls however im also trying to redirect some old pages to the new urls but the rewrite condition is screwing up the 301 redirect.

my htaccess is 

RewriteEngine On

RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d

RewriteRule ^([^/]*) pagehandler.php?string=$1 [L]

Redirect 301 /view/facilities http://www.mysite.com/facilities

what is happening is if go to 
http://www.mysite.com/view/facilities
im  redirected to
http://www.mysite.com/facilities?string=view
rather than 
http://www.mysite.com/facilities
</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2008:site.95542</guid>
	<pubDate>Wed, 02 Jul 2008 05:31:52 -0800</pubDate>
	<category>htaccess</category>
	<dc:creator>toocan</dc:creator>
	</item>
	<item>
	<title>Redirect images &amp;amp; mp3s to mirror via htaccess</title>
	<link>http://ask.metafilter.com/95153/Redirect%2Dimages%2Dand%2Dmp3s%2Dto%2Dmirror%2Dvia%2Dhtaccess</link>	
	<description>How do I redirect all my website&apos;s images and mp3s to another domain via .htaccess? I have a domain (foo.com) that ordinarily serves my website and its images and mp3s. I have a mirror (bar.com) that has a mirror/backup of all those images and mp3s. &lt;br&gt;
&lt;br&gt;
In the event of a traffic surge on foo.com, I want to make Apache serve all my images and mp3s from bar.com. &lt;br&gt;
&lt;br&gt;
All I can find is examples to stop others from hot-linking my files, which isn&apos;t what I want.&lt;br&gt;
&lt;br&gt;
(Bonus aside question: Am I not turning up examples of this because it&apos;s better done in httpd.conf some way?)</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2008:site.95153</guid>
	<pubDate>Thu, 26 Jun 2008 21:13:40 -0800</pubDate>
	<category>apache</category>
	<category>htaccess</category>
	<category>images</category>
	<category>mod_rewrite</category>
	<category>mp3</category>
	<dc:creator>frenetic</dc:creator>
	</item>
	<item>
	<title>Just like the neighbor&apos;s cat in your kids&apos; sandbox...</title>
	<link>http://ask.metafilter.com/94742/Just%2Dlike%2Dthe%2Dneighbors%2Dcat%2Din%2Dyour%2Dkids%2Dsandbox</link>	
	<description> What am I doing to my links pointing to images in a private directory that prevents me from seeing the pics in &lt;em&gt;Dreamweaver CS3&lt;/em&gt; Design mode? Searching Adobe&apos;s Knowlegebase and Google yields a flood of others&apos; issues with setting up passworded sites or &lt;em&gt;Dreamweaver&lt;/em&gt; forgetting FTP login info and I can&apos;t narrow the results to the problem I&apos;m having.&lt;br&gt;
&lt;br&gt;
I just started building a web site and I&apos;m rusty in HTML and am learning CSS. After I edit the code, I do like to check it out in Design view. Currently, I&apos;m uploading things to a private directory (passworded .htaccess on a Zeus server not managed by me) so my business partner can see pages before the site goes &quot;live.&quot; Viewing the site through a browser, one is prompted to enter the name and password to see this directory&apos;s content. No problems there. I have no troubles with file management in &lt;em&gt;DW&lt;/em&gt;&apos;s FTP prog or in &lt;em&gt;FileZilla&lt;/em&gt;, either. &lt;br&gt;
&lt;br&gt;
Suppose the page I&apos;m working on is located at http://www.[mydumbsite].com/public_html/sandbox/mydumbpage.htm . &quot;Sandbox&quot; is the passworded directory. My stylesheet for CSS is located in the same directory and the page refers directly to &lt;em&gt;mydumbstylesheet.css&lt;/em&gt; . The pics reside below &quot;sandbox&quot; in folders &quot;dumbimages&quot; and &quot;dumbimages/dumbthumbs.&quot; The stylesheet&apos;s effects on my .html pages show up in Design mode. The images do not. When it&apos;s all said and done, the images ARE there on the site and appear in the final product. I would just like to know what I&apos;m doing or not doing that keeps me from being able to preview.&lt;br&gt;
&lt;br&gt;
How do I refer to the image locations the short way (vs. &quot;http://www.[mydumbsite].com/public_html/sandbox/images/dumbpic.jpg&quot;) so &lt;em&gt;DW&lt;/em&gt; is not blocked access? Or Is there a way to tell DW to prompt me to get into pw&apos;d dirs in preview mode?&lt;br&gt;
&lt;br&gt;
Any other methods/advice (other than &quot;&lt;em&gt;OMG don&apos;t use THAT program, I write code with Sith blood on tree bark&lt;/em&gt;&quot;) are welcome.&lt;br&gt;
&lt;br&gt;
Thanks!</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2008:site.94742</guid>
	<pubDate>Sun, 22 Jun 2008 19:06:04 -0800</pubDate>
	<category>dir</category>
	<category>directory</category>
	<category>Dreamweaver</category>
	<category>DreamweaverCS3</category>
	<category>filetransferprotocol</category>
	<category>FTP</category>
	<category>htaccess</category>
	<category>HTML</category>
	<category>htpasswd</category>
	<category>hypertextmarkuplanguage</category>
	<category>password</category>
	<category>resolved</category>
	<dc:creator>bonobo</dc:creator>
	</item>
	<item>
	<title>Redirecting subdomain to https</title>
	<link>http://ask.metafilter.com/93830/Redirecting%2Dsubdomain%2Dto%2Dhttps</link>	
	<description>I need to redirect all traffic on a subdomain to https instead of http. mod_rewrite is installed, but I don&apos;t know how to use it. So for a couple different subdomains I need to force https in other words I want any requests to: &lt;br&gt;
&lt;br&gt;
http://sub1.example.com&lt;br&gt;
&lt;br&gt;
to go to: &lt;br&gt;
https://sub1.example.com &lt;br&gt;
&lt;br&gt;
I found a couple examples online, but I&apos;m not familiar enough with mod_rewrite and .htaccess files enough to make it work. Help, I&apos;m clueless!</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2008:site.93830</guid>
	<pubDate>Wed, 11 Jun 2008 14:44:44 -0800</pubDate>
	<category>htaccess</category>
	<category>https</category>
	<category>mod_rewrite</category>
	<category>subdomain</category>
	<dc:creator>The Radish</dc:creator>
	</item>
	<item>
	<title>Regex woes.</title>
	<link>http://ask.metafilter.com/93745/Regex%2Dwoes</link>	
	<description>Not quite getting how mod_rewrite regex works when flatting urls with multiple variables. Hello hello,&lt;br&gt;
&lt;br&gt;
Ok, so I&apos;m working on another website but I have run into what I&apos;m sure is a pretty basic problem that I can&apos;t seem to wrap my head around. I use mod_rewrite pretty frequently to flatten the most basic types of dynamic urls, those with only one variable. But now I need to figure out how to configure my htaccess to handle urls that always have one variable, but sometimes also have 2-3.&lt;br&gt;
&lt;br&gt;
Now if I knew the same number of variables would be present all the time I think I could handle it, but when there is a variable number of variables I just can&apos;t seem to figure out what I&apos;m doing.&lt;br&gt;
&lt;br&gt;
Here is an example of what I do know how to do. Let&apos;s say I want to change the url: &lt;br&gt;
&lt;br&gt;
   http://mywebsite.com/profile/jeremy/&lt;br&gt;
&lt;br&gt;
into:&lt;br&gt;
&lt;br&gt;
   http://mywebsite.com/profile.php?name=jeremy&lt;br&gt;
&lt;br&gt;
I&apos;d use:&lt;br&gt;
&lt;br&gt;
   ReWriteRule ^profile/([A-Za-z]+)/$ /profile.php?name=$1&lt;br&gt;
&lt;br&gt;
but if sometimes I also add extra variables like so:&lt;br&gt;
&lt;br&gt;
   http://mywebsite.com/profile/jeremy/action/sort/order/desc/&lt;br&gt;
&lt;br&gt;
into:&lt;br&gt;
&lt;br&gt;
   http://mywebsite.com/profile.php?name=jeremy&amp;amp;action=sort&amp;amp;order=desc&lt;br&gt;
&lt;br&gt;
Then I just can&apos;t seem to wrap my head around it. Especially if depending on circumstances I might have urls like so where the 2nd variable in the previous example is missing, but the third is still round:&lt;br&gt;
&lt;br&gt;
   http://mywebsite.com/profile/jeremy/order/desc/&lt;br&gt;
  &lt;br&gt;
I&apos;ve Googled around but it seems most websites toughing on the subject are either too simple (and just give examples with single variables) or are too complicated and assume I already have abase level of regex knowledge which I sadly lack. &lt;br&gt;
&lt;br&gt;
So would any kindly Mefite want to give me a walk through on what exactly I should be trying to do (and most importantly why, so that I can avoid  just rote copy/pasting and instead be able to solve these kind of problems myself in the future =)&lt;br&gt;
&lt;br&gt;
Thanks much!&lt;br&gt;
Jeremy</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2008:site.93745</guid>
	<pubDate>Tue, 10 Jun 2008 17:27:29 -0800</pubDate>
	<category>htaccess</category>
	<category>regex</category>
	<category>url</category>
	<dc:creator>Jezztek</dc:creator>
	</item>
	<item>
	<title>getting .htaccess to do httpd.conf&apos;s job</title>
	<link>http://ask.metafilter.com/92955/getting%2Dhtaccess%2Dto%2Ddo%2Dhttpdconfs%2Djob</link>	
	<description>Mod_rewrite and subdirectories and subdomains, oh my! I&apos;m using a hosting service (Lunarpages) that maps the document root of subdomains to a corresponding subdirectory in the primary domain root (i.e. the public_html directory). Thus: &lt;tt&gt;sub1.mysite com&lt;/tt&gt; has &lt;tt&gt;mysite.com/sub1/&lt;/tt&gt; as its &lt;tt&gt;/&lt;/tt&gt; directory.&lt;br&gt;
&lt;br&gt;
I&apos;ve also got &lt;tt&gt;sub2.mysite.com&lt;/tt&gt;, which has its document root automatically and unalterably set to &lt;tt&gt;mysite.com/sub2/&lt;/tt&gt;. I would like URLs to &lt;tt&gt;sub2.mysite.com&lt;/tt&gt; to be rewritten so that they go to &lt;tt&gt;sub1.mysite.com&lt;/tt&gt;. A standard external redirect isn&apos;t going to work in this case, because the code in &lt;tt&gt;/foo/&lt;/tt&gt; needs to parse the incoming subdomain. &lt;br&gt;
&lt;br&gt;
Got .htaccess, anyone?&lt;br&gt;
&lt;br&gt;
(This is, of course, something that would take 0.3s to solve if I could get at the bloody httpd.conf.)</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2008:site.92955</guid>
	<pubDate>Mon, 02 Jun 2008 03:37:58 -0800</pubDate>
	<category>apache</category>
	<category>htaccess</category>
	<category>mod_rewrite</category>
	<category>server</category>
	<category>web</category>
	<dc:creator>holgate</dc:creator>
	</item>
	
	</channel>
</rss>

