lets say i make a request to  so my picture.jpg is supposed to be in htdocs/files/picture.jpg  how do i configure if picture.jpg does not exist in htdocs/files then look it up inside htdocs/files/alt?  the filename varies, but the alternate directory name (alt) is fixed (which reside inside the original directory)  is this achievable using apache config?
487
This is a  about Apache's mod_rewrite.   Changing a request URL or redirecting users to a different URL than the one they originally requested is done using mod_rewrite. This includes such things as:   Changing HTTP to HTTPS (or the other way around) Changing a request to a page which no longer exist to a new replacement. Modifying a URL format (such as ?id=3433 to /id/3433 ) Presenting a different page based on the browser, based on the referrer, based on anything possible under the moon and sun. Anything you want to mess around with URL   Everything You Ever Wanted to Know about Mod_Rewrite Rules but Were Afraid to Ask!  How can I become an expert at writing mod_rewrite rules?   What is the fundamental format and structure of mod_rewrite rules? What form/flavor of regular expressions do I need to have a solid grasp of? What are the most common mistakes/pitfalls when writing rewrite rules? What is a good method for testing and verifying mod_rewrite rules? Are there SEO or performance implications of mod_rewrite rules I should be aware of? Are there common situations where mod_rewrite might seem like the right tool for the job but isn't? What are some common examples?   A place to test your rules  The  web site is a great place to play around with your rules and test them. It even shows the debug output so you can see what matched and what did not.
21080
I got a bunch of files with the filename messed up. All the file names have the same beginning which appear to be windows file directories. The problem is there are 700+ files and I really don't want go through and manually rename all of them. These are examples of the file names (Note: None of these have file directories):  G:some\really\long\file\path\then\the\name1.jpg G:some\really\long\file\path\then\the\name2.png G:some\really\long\file\path\then\the\filename.txt G:some\really\long\file\path\then\the\file_name.mov ...   The important take away is that each file has G:some\really\long\file\path\then\the\ before the file name that I would like.   So I would want the above files to look like:  name1.jpg name2.png filename.txt file_name.mov   I've tried the rename command and was not successful. I am still new with Linux and really am not sure on how to go about it or really what to google. Any help would be appreciated.
27334
when we specify the file path some times we specify like ./filename and some time ../filename what is difference between these two?
62628
I have an nginx configuration with a whole bunch of server {} blocks. I want to share error pages between them all, but many of them have different document roots. I can use a configuration like  error_page   404              /404.html; error_page   500 502 503 504  /50x.html;   outside of the server blocks and it gets shared, but then I have to put those same documents in all the roots, or have rules like  location = /404.html {     root /srv/http/errors; } location = /50x.html {     root /srv/http/errors; }   in all my server blocks.  Is there a way to share these documents without repeating myself over and over or having many copies in the filesystem?
107355
User posted a link to  in . So I edited it to actually show the image. I didn't remember image syntax used here, so I used GUI button. that was much faster than reading syntax help and I expected it to gave me the same result as manual wrapping URL into image tags. I was surprised to see  as created URL. I replaced new one with old URL and it worked good, too, so reupload wasn't really needed.  It seems each time someone will want to correct broken markup using GUI tools, new copy of image will be created. It's both a waste of time and HDD space. Could you add filter to GUI tools, so that if image is already on stack.imgur.com your tool would not try to upload it again, but would just use the copy available there?  Tested on  and , in this very post.
67152
I would like to create a page where all images which reside on my website are listed with title and alternative representation.  I already wrote me a little program to find and load all HTML files, but now I am stuck at how to extract src, title and alt from this HTML:  &lt;img src="/image/fluffybunny.jpg" title="Harvey the bunny" alt="a cute little fluffy bunny" />  I guess this should be done with some regex, but since the order of the tags may vary, and I need all of them, I don't really know how to parse this in an elegant way (I could do it the hard char by char way, but that's painful).
11740
I'm running tests of a variable-size-and-contents test set. Data files are added and removed frequently. I'm looking for an automated way of gathering a file list.  All files are in subdirectories of D; I need the full directory and name added to a text file. However, I only need those files that have a "paired" file, which has the same filename but a different extension (so... different filename, but in a structured way). So, if there is a MyFileName.A and MyFileName.B, then I want D/.../MyFileName added to the file list.  There are .A files without .B files, but no .B files without .A files. If a .A has a .B file, then both files are in the same directory.   Any advice?
7760
I have a directory full of images:  image0001.png image0002.png image0003.png ...   And I would like a one-liner to rename them to (say).  0001.png 0002.png 0003.png ...   How do I do this?
3629
I would like to search for files that would not match 2 -name conditions. I can do it like so :   find /media/d/ -type f -size +50M ! -name "*deb" ! -name "*vmdk"   and this will yield proper result but can I join these 2 condition with OR somehow ?
29780
I am trying to convert a bunch of images to thumbnails that might be in several subdirectories, and save a copy of the image as a thumbnail inside the subdirectory, but I can't figure out the syntax. Any advice would be welcome.   convert test/*/*.jpg -50x50 test/*/*_thumb.jpg
1592
On my desktop I have a .desktop file. If I type:  Icon=/home/ianbell/Pictures/myLogo.png   the icon of the .desktop file changes (the expected result).  But, if I type:  Icon=~/Pictures/myLogo.png   it doesn't work.  Isn't ~/ a shortcut for /home/$USER?
48917
There is a file in my public_html folder called error.log which is viewable by anyone if they just enter the URL in their browser, like: example.com/error.log  I'm running Apache. My question is, how can I hide or perhaps move this error.log so that it isn't visible to regular users?  ErrorDocument 401 default ErrorDocument 403 default ErrorDocument 404 default ErrorDocument 500 default  &lt;IfModule mod_rewrite.c&gt; RewriteEngine On  #   If you are having problems with the rewrite rules, remove the "#" from the #   line that begins "RewriteBase" below. You will also have to change the path #   of the rewrite to reflect the path to your XenForo installation. #RewriteBase /xenforo  #   This line may be needed to enable WebDAV editing with PHP as a CGI. #RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]  RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^error\.log$ - [F] RewriteRule ^.*$ - [NC,L] RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml|robots\.txt) - [NC,L] RewriteRule ^.*$ index.php [NC,L]
51228
I have a view with a thumbnail of the image uploaded by user. I would like to setup a default image which appears in place of thumbnail in case the user did not upload any image. Is that possible? Any advice appreciated.
89463
I downloaded the latest  and installed it.  But apparently, there is no /var/www folder.  Can anyone tell me the default location of the Apache's DocumentRoot directory within XAMPP installation?
3991
Why in Windows, can't you name a folder 'con'?  Whenever I try to name a folder as "con" (without the quotes) it defaults to its original name.  Why does it do this?
38971
Is there an option or tool that will allow me to change the default naming convention for files copied into the same directory in Windows (XP) and above.  e.g. from: Copy of {name}.{ext} to: {name}.{ext}.copy  Currently:  original_file.php Copy of original_file.php   Desired:  original_file.php original_file.php.copy   This would make finding/working with duplicated files much easier (they auto-sort together) and the filetype (by extension) changes thus it can't accidentally "break" something (e.g. if it were a *.java file, upon compiling I would get errors)
2593
For the apple.stackexchange question  a 2nd answer was given, which relates to the question, but IMHO does not answer a majority portion of the question. Here some details:   The question is about, how to set the PATH variable in a unified manner. The  details how to change the file /etc/launch.conf. It is to note, that changing this file is needed for the overall answer. The author of the answer does make the valid point that, when he searched for, how to change /etc/launch.conf, the question came up. The  does not detail the change of /etc/launch.conf enough.   So, the general problem is: What to do when an additional answer explains only a small (but unique portion) of the question, while an earlier answer explains more (but not what the additional question explains).  Finally, I think I should note that I am the initial asker and poster of the 1st answer.