<?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 posts tagged with htaccess</title>
      <link>http://ask.metafilter.com/tags/htaccess</link>
      <description>tag posts with htaccess</description>
	  	  <pubDate>Wed, 23 Jul 2008 10:03:34 -0800</pubDate>
      <lastBuildDate>Wed, 23 Jul 2008 10:03:34 -0800</lastBuildDate>

      <language>en-us</language>
	  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
	  <ttl>60</ttl>	  
	<item>
	<title>Can I combine htaccess and session variables from other systems?</title>
	<link>http://ask.metafilter.com/97321/Can-I-combine-htaccess-and-session-variables-from-other-systems</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>web</category>

<category>server</category>

<category>htaccess</category>

<category>authentication</category>

<category>session</category>

<category>variables</category>

	<dc:creator>jpoulos</dc:creator>
	</item>
	<item>
	<title>.htaccess files and groups</title>
	<link>http://ask.metafilter.com/96318/htaccess-files-and-groups</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>htaccess</category>

<category>server</category>

<category>apache</category>

<category>permissions</category>

	<dc:creator>chillmost</dc:creator>
	</item>
	<item>
	<title>htaccess and description column</title>
	<link>http://ask.metafilter.com/96278/htaccess-and-description-column</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>htaccess</category>

<category>description</category>

<category>file</category>

<category>directory</category>

<category>apache</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-you-help-me-with-htaccess-and-301-redirects</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-images-amp-mp3s-to-mirror-via-htaccess</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>htaccess</category>

<category>mod_rewrite</category>

<category>images</category>

<category>mp3</category>

<category>apache</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-like-the-neighbors-cat-in-your-kids-sandbox</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>Dreamweaver</category>

<category>DreamweaverCS3</category>

<category>HTML</category>

<category>hypertextmarkuplanguage</category>

<category>FTP</category>

<category>filetransferprotocol</category>

<category>password</category>

<category>htaccess</category>

<category>htpasswd</category>

<category>dir</category>

<category>directory</category>

<category>resolved</category>

	<dc:creator>bonobo</dc:creator>
	</item>
	<item>
	<title>Redirecting subdomain to https</title>
	<link>http://ask.metafilter.com/93830/Redirecting-subdomain-to-https</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>mod_rewrite</category>

<category>htaccess</category>

<category>subdomain</category>

<category>https</category>

	<dc:creator>The Radish</dc:creator>
	</item>
	<item>
	<title>Regex woes.</title>
	<link>http://ask.metafilter.com/93745/Regex-woes</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>regex</category>

<category>htaccess</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-htaccess-to-do-httpdconfs-job</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>mod_rewrite</category>

<category>apache</category>

<category>web</category>

<category>server</category>

<category>htaccess</category>

	<dc:creator>holgate</dc:creator>
	</item>
	<item>
	<title>&apos;Fsockopen&apos;, Plus A Couple of Googlebot Questions</title>
	<link>http://ask.metafilter.com/92796/Fsockopen-Plus-A-Couple-of-Googlebot-Questions</link>	
	<description>Website help: I&apos;m asking for some input on (1) straightening out a problem with Google and its &quot;description&quot; for each page of my blog; (2) constructing a robots.txt exclusion for certain types of archive pages; and (3) the reason why something is looking for page URLs that have &quot;function.fsockopen&quot; at the end of them. &lt;b&gt;(1)&lt;/b&gt;&lt;br&gt;
Google seems to be using the first bit of text from my blog &#8212; its subtitle and a phrase &quot;Skip to content&quot; which I don&apos;t see anywhere &#8212; as opposed to what is in the META description tag.  (&lt;a href=&quot;http://www.google.com/search?num=100&amp;hl=en&amp;newwindow=1&amp;btnG=Google+Search&amp;as_epq=&amp;as_oq=&amp;as_eq=&amp;lr=&amp;as_ft=i&amp;as_filetype=&amp;as_qdr=all&amp;as_occt=any&amp;as_dt=i&amp;as_sitesearch=&amp;as_rights=&amp;safe=off&amp;as_q=site%3Awindycitymike.com&quot;&gt;Results in which I see this&lt;/a&gt;.)  I prefer it to index the latter, since the META description is an excerpt from the page and thus is better for search engines.&lt;br&gt;
&lt;br&gt;
For some pages, it&apos;s appropriately indexing the META description.  But for many more (probably the majority), it still has the blog&apos;s subtitle.&lt;br&gt;
&lt;br&gt;
Is this merely a case of the pages with subtitles not having been visited by the Googlebot spider recently?  If so, is there anything I can do to get Google to respider the whole site?  I&apos;m registered with Google Webmaster Tools.  I don&apos;t have access to setting a faster crawl rate.&lt;br&gt;
&lt;br&gt;
Or is it something wrong with the page&apos;s tagging or code?  If so, what&apos;s wrong with it?&lt;br&gt;
&lt;br&gt;
&lt;b&gt;(2)&lt;/b&gt;&lt;br&gt;
I have been trying to exclude archive pages from search engines; the post&apos;s entire content is reproduced there and Google doesn&apos;t like duplication.  I do have lt;meta name=&quot;googlebot&quot; content=&quot;noindex,noarchive,follow,noodp&quot; /&gt;&lt;meta name=&quot;robots&quot; content=&quot;noindex,follow&quot; /&gt;&lt;meta name=&quot;msnbot&quot; content=&quot;noindex,follow&quot; /&gt; in the archive headers, but I had also tried to exclude it via robots.txt.&lt;br&gt;
&lt;br&gt;
Unfortunately, my attempt at doing so ended up excluding a good handful of sites it shouldn&apos;t&apos;ve.  My attempt was:&lt;br&gt;
Allow: /200*/*/*/*/&lt;br&gt;
Disallow: /200&lt;br&gt;
&lt;br&gt;
The idea was to allow URLs in this format &#8212; http://www.&lt;i&gt;[sitename]&lt;/i&gt;.com/2008/09/11/blog-post &#8212; but to disallow all other posts that began with 200 &#8212; which would cover all the archive pages.&lt;br&gt;
&lt;br&gt;
Can I just invert the two (put the disallow before the allow) to fix that?  Or is there another way to do it?  This is &lt;a href=&quot;http://www.windycitymike.com/robots.txt&quot;&gt;my site&apos;s robots.txt file&lt;/a&gt;.&lt;br&gt;
&lt;br&gt;
&lt;b&gt;(3)&lt;/b&gt;&lt;br&gt;
I&apos;m told that Googlebot could not find about 18 pages that were mentioned &quot;either in your Sitemap or by following links from other pages during a discovery crawl.&quot;  7 of them are quirks or links I had to fix, but 11 of them were in this format:&lt;br&gt;
&lt;br&gt;
http://www.&lt;i&gt;[sitename]&lt;/i&gt;.com/2004/10/25/blogger-1025-0648-pm/function.fsockopen&lt;br&gt;
&lt;br&gt;
I have absolutely no idea what&apos;s causing this.  Is it something on my end?  These &quot;fsockopen&quot; listings are not in my sitemap (I double-checked).  I&apos;m really not even sure where to begin researching this one.  I do have this in my htaccess file, if it&apos;s a possible cause:&lt;br&gt;
&lt;br&gt;
AddType application/x-httpd-php5 .php&lt;br&gt;
AddHandler application/x-httpd-php5 .php</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2008:site.92796</guid>
	<pubDate>Fri, 30 May 2008 12:38:40 -0800</pubDate>

<category>wordpress</category>

<category>htaccess</category>

<category>robots</category>

<category>fsockopen</category>

<category>googlebot</category>

<category>sitemap</category>

<category>stumped</category>

	<dc:creator>WCityMike</dc:creator>
	</item>
	<item>
	<title>How do I make pretty URLs work in BBpress?</title>
	<link>http://ask.metafilter.com/89625/How-do-I-make-pretty-URLs-work-in-BBpress</link>	
	<description>How on earth do I get pretty URLs to work in BBpress, when in a subdirectory of a Wordpress install? Right. Being more than a little bit out of my technical depth here, I suspect I&apos;m missing something obvious.&lt;br&gt;
&lt;br&gt;
I&apos;m running a BBpress install in a subfolder of my word-press installation.  The two are otherwise well integrated, except Wordpress does gorgeous, pretty URLs, but BBpress does not.&lt;br&gt;
&lt;br&gt;
Apparently, I&apos;m not the only who has had this problem.  I&apos;ve tried &lt;a href=&quot;http://bbpress.org/documentation/faq/&quot;&gt;this&lt;/a&gt;, &lt;a href=&quot;http://bbpress.org/forums/topic/no-htaccess-file-for-pretty-urls&quot;&gt;these&lt;/a&gt; and some farting around of my own.  Nothing has worked, and I&apos;m at my wits end on this.  I change the .htaccess, upload it, turn on pretty URLs in BBpress, and bang - 404s across the board.  It generates the URLs just fine, but it doesn&apos;t interpret them.  &lt;br&gt;
&lt;br&gt;
I think the problem might be that the .htaccess in my Wordpress folder overwriting the .htaccess I use in the BBpress subfolder.  But really, I have no idea what I&apos;m talking about.  I use 1and1 as my host, if that makes a difference.&lt;br&gt;
&lt;br&gt;
Has anyone else licked this problem? Is there a tutorial that my search skills haven&apos;t found?  That I&apos;ve missed in my misery?  I will weep with joy when I find a solution to this one.  Normally I can figure this stuff out with a little investigation and experimentation.</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2008:site.89625</guid>
	<pubDate>Wed, 23 Apr 2008 13:24:16 -0800</pubDate>

<category>bbpress</category>

<category>wordpress</category>

<category>htaccess</category>

<category>mod_rewrite</category>

	<dc:creator>generichuman</dc:creator>
	</item>
	<item>
	<title>Drupal and the missing links.</title>
	<link>http://ask.metafilter.com/88461/Drupal-and-the-missing-links</link>	
	<description>Drupal:  Copying a site to a test site (subdirectory).  The links, they go nowhere! So I followed Drupal&apos;s &lt;a href=&quot;http://drupal.org/upgrade/copying-your-site-via-GUI&quot;&gt;Copying your live site to a test site&lt;/a&gt; documentation.  &lt;br&gt;
&lt;br&gt;
My original site is http://foo.com, and my test site is http://foo.com/test/&lt;br&gt;
&lt;br&gt;
I&apos;ve done the following:&lt;br&gt;
 - copied the contents of public/ to public/test/&lt;br&gt;
 - done an export of the DB, changed the contents of the export so that any reference to foo.com/ now says  foo.com/test/ and done an import to a new DB&lt;br&gt;
 - I&apos;ve added public/sites/foo.com.test/setup.php that points to the new db_url and has foo.com/test as a base_url.  &lt;br&gt;
&lt;br&gt;
I&apos;m able to access the main page of the test site, and when I mouse over a url it will show foo.com/test/example/ but when I click on it, I get a Page Not Found message, but within the drupal theme.  Here&apos;s the interesting part... in the page not found page, all the links are from the main site, not the test site.&lt;br&gt;
&lt;br&gt;
I wonder if .htaccess has something to do with it.  I don&apos;t know much about it but here&apos;s what&apos;s in the .htaccess in  public/ : &lt;br&gt;
&lt;br&gt;
&amp;lt;IfModule mod_rewrite.c&amp;gt;&lt;br&gt;
  RewriteEngine on&lt;br&gt;
  # Rewrite current-style URLs of the form &apos;index.php?q=x&apos;.&lt;br&gt;
  RewriteCond %{REQUEST_FILENAME} !-f&lt;br&gt;
  RewriteCond %{REQUEST_FILENAME} !-d&lt;br&gt;
  RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]&lt;br&gt;
&amp;lt;/IfModule&amp;gt;&lt;br&gt;
&lt;br&gt;
I should also mention that I&apos;m using clean urls and Drupal 5.5.</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2008:site.88461</guid>
	<pubDate>Thu, 10 Apr 2008 13:48:32 -0800</pubDate>

<category>drupal</category>

<category>subdomain</category>

<category>subdirectory</category>

<category>htaccess</category>

	<dc:creator>Null Pointer and the Exceptions</dc:creator>
	</item>
	<item>
	<title>Why is Apache not listing any files in an open directory?</title>
	<link>http://ask.metafilter.com/87072/Why-is-Apache-not-listing-any-files-in-an-open-directory</link>	
	<description>I&apos;ve been helping my friend setup his personal website and we have been muddling through with plenty of help from google and a little bit of luck.

But recently, I&apos;ve been stumped by a persistent problem with a directory containing some files. Here&apos;s the scenario - my friend shares his RSS reading list as an OPML file. In addition, he wants to try and show how his reading list has evolved by archiving older versions of his reading list in a folder. He also wants to allow other people to browse this archive folder.

It seemed like we should be able to achieve this using .htaccess files, but unfortunately  it&apos;s not working like we expected. The .htaccess file that we came up with is as follows:&lt;br&gt;
&lt;blockquote&gt;&lt;br&gt;
Options +Indexes +MultiViews +FollowSymlinks&lt;br&gt;
&lt;ifmodule&gt;&lt;br&gt;
IndexOptions FancyIndexing&lt;br&gt;
&lt;/ifmodule&gt;&lt;br&gt;
&lt;br&gt;
order allow,deny&lt;br&gt;
allow from all&lt;br&gt;
&lt;/blockquote&gt;&lt;br&gt;
&lt;br&gt;
The directory can be viewed &lt;a href=&quot;http://linkblog.balaji-dutt.name/resources/opml_archive/&quot;&gt;at this link&lt;/a&gt;. At first I thought it might be a problem with file permissions, so I tried CHMOD&apos;ing all files to 777 but the folder remains empty. Next, I tried to see if any file was getting displayed and uploaded a text file and a jpeg to the directory and found that nothing changes. So it isn&apos;t a problem with unrecognized file types, nothing is getting picked up!&lt;br&gt;
&lt;br&gt;
In the root folder of the linkblog, there is a htaccess file that has the following entry:&lt;br&gt;
&lt;blockquote&gt;&lt;br&gt;
# BEGIN Prevent Directory Listing&lt;br&gt;
IndexIgnore *&lt;br&gt;
# END Prevent Directory Listing&lt;br&gt;
&lt;/blockquote&gt;&lt;br&gt;
&lt;br&gt;
I tried to force an override by including an Override Indexes command as follows:&lt;br&gt;
&lt;blockquote&gt;&lt;br&gt;
&amp;lt; Directory &quot;/home/content/linkblog/resources/opml_archive&quot; &amp;gt;&lt;br&gt;
AllowOverride Indexes&lt;br&gt;
&lt;/blockquote&gt;&lt;br&gt;
&lt;br&gt;
That only resulted in a &quot;500 Internal Server Error&quot;.&lt;br&gt;
&lt;br&gt;
Additional info: The server is hosted at GoDaddy.&lt;br&gt;
&lt;br&gt;
If the question seems long and rambly, apologies - this is my first question to AskMeFi and I figured it&apos;s better to go overboard with the data points :)</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2008:site.87072</guid>
	<pubDate>Tue, 25 Mar 2008 21:46:56 -0800</pubDate>

<category>htaccess</category>

<category>directories</category>

<category>apache</category>

<category>listing</category>

	<dc:creator>your mildly obsessive average geek</dc:creator>
	</item>
	<item>
	<title>%{QUERY_STRING} the Hivemind</title>
	<link>http://ask.metafilter.com/84141/QUERYSTRING-the-Hivemind</link>	
	<description>Mod_rewrite &amp;amp; query strings: Just when I thought I had it figured out... I was wanting to redirect from old files [home|fotos|foo|bar].asp with query string variables id &amp;amp; lid to a new &amp;amp; nicer URL /XXX/[index|pics|foozie|barrie], where XXX was an alias dependant on the two values. So I managed to suss out the following&lt;br&gt;
&lt;br&gt;
&lt;code&gt;  RewriteCond %{QUERY_STRING}  ^id=123&amp;amp;lid=456$ [NC]&lt;br&gt;
  RewriteRule ^home\.asp$ /whatever/index? [R=301,NC,L]&lt;br&gt;
  RewriteRule ^fotos\.asp$ /whatever/pics? [R=301,NC,L]&lt;br&gt;
  RewriteRule ^foo\.asp$ /whatever/foozie? [R=301,NC,L]&lt;br&gt;
  RewriteRule ^bar\.asp$ /whatever/barrie? [R=301,NC,L]&lt;br&gt;
&lt;br&gt;
  RewriteCond %{QUERY_STRING}  ^id=456&amp;amp;lid=789$ [NC]&lt;br&gt;
  RewriteRule ^home\.asp$ /whatever2/index? [R=301,NC,L]&lt;br&gt;
  RewriteRule ^fotos\.asp$ /whatever2/pics? [R=301,NC,L]&lt;br&gt;
  RewriteRule ^foo\.asp$ /whatever2/fooozie? [R=301,NC,L]&lt;br&gt;
  RewriteRule ^bar\.asp$ /whatever2/barrie? [R=301,NC,L]&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
which works nicely. Yay me.&lt;br&gt;
&lt;br&gt;
But now I discovered some search results where variables other than id &amp;amp; lid are appended to the query string. I don&apos;t give a flying rat&apos;s arse about these variables. I just want to be redirected to /whatever/index if the old request was for home.asp and id=123 &amp;amp; lid=456.&lt;br&gt;
&lt;br&gt;
I&apos;ve tried &lt;br&gt;
&lt;code&gt;  RewriteCond %{QUERY_STRING}  ^id=456&amp;amp;lid=789.* [NC]&lt;/code&gt;&lt;br&gt;
and&lt;br&gt;
&lt;code&gt;  RewriteCond %{QUERY_STRING}  ^id=456&amp;amp;lid=789? [NC,OR]&lt;br&gt;
  RewriteCond %{QUERY_STRING}  ^id=456&amp;amp;lid=789.* [NC]&lt;/code&gt;&lt;br&gt;
as well as various other screwups. At this point I&apos;m getting blurry-eyed and have lost track of all the combinations I&apos;ve attempted.&lt;br&gt;
&lt;br&gt;
What&apos;s the totally obvious mod_rewrite voodoo I&apos;ve overlooked?</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2008:site.84141</guid>
	<pubDate>Wed, 20 Feb 2008 12:23:37 -0800</pubDate>

<category>mod_rewrite</category>

<category>htaccess</category>

<category>apache</category>

	<dc:creator>romakimmy</dc:creator>
	</item>
	<item>
	<title>Who Knows the Code?</title>
	<link>http://ask.metafilter.com/82238/Who-Knows-the-Code</link>	
	<description>&lt;b&gt;Domain Mapping via .htaccess:&lt;/b&gt; I want to map a second domain I have to a subdirectory in my main Web directory (BTW, this is &lt;i&gt;&lt;b&gt;not&lt;/b&gt;&lt;/i&gt; a Typepad blog). My ISP asked that I set up the redirect via my .htaccess file but failed to supply the code to do that (we&apos;re having a little chat about suggesting I do something without giving me the tools I need to do it -g). That being said, I&apos;m familiar with .htaccess (I have one in place with code to deal with certain sites which are stealing my bandwidth). However, I&apos;m not well-versed in creating the code to map my new domain to the subdirectory I&apos;ve created. &lt;br&gt;
&lt;br&gt;
I&apos;m hoping someone in the AskMeFi hive can supply me with the code (bonus points for making sure that both www.mysite.com and mysite.com will go to my subdirectory). Thanks.</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2008:site.82238</guid>
	<pubDate>Tue, 29 Jan 2008 07:04:14 -0800</pubDate>

<category>domainmapping</category>

<category>htaccess</category>

	<dc:creator>Taken Outtacontext</dc:creator>
	</item>
	<item>
	<title>mod_rewrite, modern delight.</title>
	<link>http://ask.metafilter.com/80854/modrewrite-modern-delight</link>	
	<description>I&apos;m moving a website from one host to another and adding a level to the directory structure. How can I do this with mod_rewrite? Site v.1 is hosted at one provider, and, in advance of rolling out v.2, we&apos;re switching hosts as well. To avoid DNS propagation issues, we&apos;re moving the new site to http://domain-at-newhost/v1/ where it should live until v.2 is launched.&lt;br&gt;
&lt;br&gt;
I think I should be able to use mod_rewrite in a .htaccess file to rewrite requests for http://domain-at-newhost/directory/file.html to http://domain-at-newhost/v1/directory/file.html, but can&apos;t get it to work for nested directories. Anybody?</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2008:site.80854</guid>
	<pubDate>Sat, 12 Jan 2008 16:50:29 -0800</pubDate>

<category>htaccess</category>

<category>mod_rewrite</category>

	<dc:creator>piro</dc:creator>
	</item>
	<item>
	<title>404 Not Found</title>
	<link>http://ask.metafilter.com/79340/404-Not-Found</link>	
	<description>Why are the 404 pages on my server broken?! I get a 500 Internal Server Error instead. Link to my .htaccess inside. Here&apos;s &lt;a href=&quot;http://corvalis.net/&quot;&gt;my webpage&lt;/a&gt;.&lt;br&gt;
&lt;br&gt;
Here&apos;s &lt;a href=&quot;http://corvalis.net/wheresmy404&quot;&gt;what happens when you go to a page that doesn&apos;t exist&lt;/a&gt;.&lt;br&gt;
&lt;br&gt;
But I get an Internal Server Error instead!&lt;br&gt;
&lt;br&gt;
Now, I&apos;m suspecting that the problem lies in my .htaccess file, but I can&apos;t be certain. I can&apos;t link directly to it, because you get the &lt;a href=&quot;http://corvalis.net/.htaccess&quot;&gt;403 Forbidden page&lt;/a&gt;, properly. So here&apos;s the &lt;a href=&quot;http://corvalis.net/htaccess.txt&quot;&gt;text file version of its exact contents&lt;/a&gt;.&lt;br&gt;
&lt;br&gt;
Any suggestions? Anything I&apos;m overlooking??</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2008:site.79340</guid>
	<pubDate>Sun, 23 Dec 2007 10:40:56 -0800</pubDate>

<category>html</category>

<category>webpage</category>

<category>server</category>

<category>htaccess</category>

<category>404</category>

<category>error</category>

	<dc:creator>lou</dc:creator>
	</item>
	<item>
	<title>How to configure a PHP script that generates Twitter images?</title>
	<link>http://ask.metafilter.com/76578/How-to-configure-a-PHP-script-that-generates-Twitter-images</link>	
	<description>Need an assist from the PHP gurus. I&apos;m trying to set up a PHP script that generates an image from the latest Twitter status. I&apos;m working off an example &lt;a href=&quot;http://www.loonypandora.com/2007/07/12/make-an-image-from-your-twitter-status/&quot;&gt;here&lt;/a&gt;.&lt;br&gt;
&lt;br&gt;
Followed the instructions there explicitly -- tried saving the script as a PHP file and got errors like this:&lt;br&gt;
&lt;br&gt;
Warning: filemtime(): Stat failed for twitter.txt (errno=2 - No such file or directory) in [...] on line 30&lt;br&gt;
&lt;br&gt;
Fatal error: Call to undefined function: simplexml_load_file() in [...] on line 34&lt;br&gt;
&lt;br&gt;
I assigned the correct permissions to the file. When I tried renaming the file as a PNG (as suggested for using on forums that require an image extension), it just gives me a corrupt PNG file when I access it. Trying both versions of .htaccess suggested in the example did not fix this.&lt;br&gt;
&lt;br&gt;
Other possibly relevant info: test site is hosted on GoDaddy and I&apos;m not sure if there&apos;s any PHP issues with them.&lt;br&gt;
&lt;br&gt;
So, is there something obvious I might be missing that isn&apos;t listed on the above linked site? Is there an easier way to generate an image of Twitter updates?</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2008:site.76578</guid>
	<pubDate>Mon, 19 Nov 2007 02:45:32 -0800</pubDate>

<category>PHP</category>

<category>Twitter</category>

<category>PNG</category>

<category>htaccess</category>

<category>forums</category>

<category>signature</category>

	<dc:creator>empyrean</dc:creator>
	</item>
	<item>
	<title>PHP predefined variables and URLs</title>
	<link>http://ask.metafilter.com/76215/PHP-predefined-variables-and-URLs</link>	
	<description>I&apos;m developing a custom 404 page using .htaccess to redirect to the 404.html.  I&apos;m trying to use PHP (via an include in the 404.html) to show the referring page (using $_SERVER[&apos;HTTP_REFERER&apos;]).  This works fine.   I&apos;d also like to return the bad URL that originates the 404.  Is this possible using PHP? I&apos;ve reviewed the documentation at php.net regarding predefined variables but I&apos;m not seeing what I want.  If it&apos;s not possible via PHP is it possible using any other technology?   If so, any suggestions?  I do not have access to the server configuration BTW.&lt;br&gt;
&lt;br&gt;
Thanks.</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2008:site.76215</guid>
	<pubDate>Wed, 14 Nov 2007 05:10:07 -0800</pubDate>

<category>php</category>

<category>htaccess</category>

<category>404</category>

<category>web</category>

<category>development</category>

<category>resolved</category>

	<dc:creator>lyam</dc:creator>
	</item>
	<item>
	<title>My readers don&apos;t understand how permalinks and anchor tags work</title>
	<link>http://ask.metafilter.com/74991/My-readers-dont-understand-how-permalinks-and-anchor-tags-work</link>	
	<description>Is there any way to automagically strip anchor tags from externally linked URLs? I frequently use of Wordpress&apos;s &quot;more&quot; feature, meaning that many of my blog readers click &quot;more&quot; a post in its entirety. &lt;br&gt;
&lt;br&gt;
Many of my readers aren&apos;t blog geeks, so when they want to link my posts, they just grab the anchor tagged url from their browser (say, http://mysite.com/2007/10/post-title#more-474) and use that to link. This means that often when my posts are referenced on the web, readers click through and find themselves in the middle of the post.&lt;br&gt;
&lt;br&gt;
I&apos;ve tried dealing with this usual ways (posting announcements on my blog, making permalinks more prominent, adding &quot;share this post&quot; plugins, etc) but ultimately I&apos;m fighting against the way my users read my site, which is &quot;click more -- then grab the URL from their browser to link.&quot;&lt;br&gt;
&lt;br&gt;
I also explored an .htaccess solution to see if it could strip anchor tags from external links, so that they&apos;d point to http://mysite.com/2007/10/post-title instead of http://mysite.com/2007/10/post-title#more-474. But anchor tags are a browser issue, not a server one.&lt;br&gt;
&lt;br&gt;
I can&apos;t be the first blogger to have wrestled with this. Any advice other than ceasing to use the &quot;more&quot; feature?</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2008:site.74991</guid>
	<pubDate>Mon, 29 Oct 2007 22:41:05 -0800</pubDate>

<category>html</category>

<category>anchortags</category>

<category>wordpress</category>

<category>blogging</category>

<category>htaccess</category>

<category>plugins</category>

	<dc:creator>arielmeadow</dc:creator>
	</item>
	<item>
	<title>htaccess trailing slash + redirect fix?</title>
	<link>http://ask.metafilter.com/73223/htaccess-trailing-slash-redirect-fix</link>	
	<description>Is it possible to append trailing slashes AND have a URL redirect using .htaccess? I&apos;m in the middle of migrating domains (both are on the same server, if it helps) and want to redirect http://www.oldname.com/foo/ to http://foo.newdomain.com. In my .htaccess file, I have the following:&lt;br&gt;
&lt;br&gt;
Options +FollowSymLinks &lt;br&gt;
RewriteEngine on&lt;br&gt;
RewriteCond %{HTTP_HOST} .&lt;br&gt;
RewriteCond %{HTTP_HOST} !^olddomain\.com/foo&lt;br&gt;
RewriteRule (.*) http://foo.newdomain.com/$1 [R=301,L]&lt;br&gt;
&lt;br&gt;
And that works really well. However, olddomain.com/foo/ is usually accessed by dropping that trailing slash and being only olddomain.com/foo. Is there any way to get the URL to write the slash in, then redirect to the new domain?</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2008:site.73223</guid>
	<pubDate>Sat, 06 Oct 2007 21:35:20 -0800</pubDate>

<category>htaccess</category>

<category>mod_rewrite</category>

<category>webmastering</category>

	<dc:creator>Hot Like Your 12V Wire</dc:creator>
	</item>
	<item>
	<title>Easiest way to get .htaccess like access control with IIS 6? </title>
	<link>http://ask.metafilter.com/66260/Easiest-way-to-get-htaccess-like-access-control-with-IIS-6</link>	
	<description>.htaccess alternative for IIS 6? What is the easiest way to set up simple access control in IIS 6.0? &lt;br&gt;
&lt;br&gt;
Note: High-grade security is not necessary for this. If passwords are sent as plain text, as with .htaccess over http, that&apos;s fine. &lt;br&gt;
&lt;br&gt;
I&apos;m looking for the simplest solution, preferably something that can password protect a directory and every subdirectory and all their contents (when accessed from the web). No more than one user is needed. &lt;br&gt;
&lt;br&gt;
Setup: Windows Small Business Server 2003, with IIS 6. Php is available, but I&apos;m thinking some server setting would be preferable.</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2008:site.66260</guid>
	<pubDate>Thu, 05 Jul 2007 06:49:18 -0800</pubDate>

<category>iis</category>

<category>htaccess</category>

<category>acces</category>

	<dc:creator>cheerleaders_to_your_funeral</dc:creator>
	</item>
	<item>
	<title>How many redirects is too many?</title>
	<link>http://ask.metafilter.com/59649/How-many-redirects-is-too-many</link>	
	<description>.htaccess question -- how many redirects is too many? I&apos;m in the process of updating a magazine site, and changing the CMS while I&apos;m at it.&lt;br&gt;
&lt;br&gt;
I can&apos;t recreate the URL structure the old CMS used, so I think I need to &quot;manually&quot; redirect people from the old URLs to the new ones.&lt;br&gt;
&lt;br&gt;
Creating the list isn&apos;t a problem, I can automate that. But I&apos;m talking about 1000 addresses here. Is that too many to put into an .htaccess file and not experience a performace hit?&lt;br&gt;
&lt;br&gt;
Also, is there a best redirect method to use to ease Google through the transition?</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2008:site.59649</guid>
	<pubDate>Fri, 30 Mar 2007 14:23:24 -0800</pubDate>

<category>htaccess</category>

<category>cms</category>

<category>redirect</category>

<category>seo</category>

	<dc:creator>crickets</dc:creator>
	</item>
	<item>
	<title>I&apos;d like to redirect an entire directory to one specific file.</title>
	<link>http://ask.metafilter.com/58651/Id-like-to-redirect-an-entire-directory-to-one-specific-file</link>	
	<description>301 redirectrs in .htaccess: how do I redirect calendar/* to /calendar.html ?  I&apos;ve tried modifying various examples online and they result in either &quot;internal server error&quot; or a 404 caused by incorrectly redirecting /calendar/* to /calendar.html/* . Two examples from the experimentation (I&apos;m in over my head; I just want this to work):&lt;br&gt;
&lt;br&gt;
# redirect 301 /calendar http://www.domain.com/calendar.html&lt;br&gt;
# 404 due to mistake above.&lt;br&gt;
&lt;br&gt;
# RedirectMatch 301 ^/calendar/(.*).htm$ http://www.domain.com/calendar.html [L]&lt;br&gt;
# internal server error</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2008:site.58651</guid>
	<pubDate>Tue, 13 Mar 2007 20:10:18 -0800</pubDate>

<category>htaccess</category>

<category>301redirect</category>

<category>redirect</category>

<category>regex</category>

<category>wildcard</category>

<category>regularexpression</category>

<category>resolved</category>

	<dc:creator>Tuwa</dc:creator>
	</item>
	<item>
	<title>How do I write a .htaccess file the will redirect if you AREN&apos;T coming from a specific website?</title>
	<link>http://ask.metafilter.com/57107/How-do-I-write-a-htaccess-file-the-will-redirect-if-you-ARENT-coming-from-a-specific-website</link>	
	<description>How do I write a .htaccess file the will redirect if you AREN&apos;T coming from a specific website? I want to help my friend promote his services. He will provide a discount to those coming from a link I post on my website, that link will take them to a directory on his website where the prices are discounted. I want to write an htaccess file that makes it to where if you don&apos;t have my website or null in your referring header that it redirects you from his special discount directory to the root directory of his website. I&apos;ve seen examples for blocking specific sites, but not allowing specific sites only.</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2008:site.57107</guid>
	<pubDate>Fri, 16 Feb 2007 08:01:49 -0800</pubDate>

<category>htaccess</category>

<category>redirect</category>

	<dc:creator>torpark</dc:creator>
	</item>
	
	</channel>
</rss>

