I'm trying to have a parameter that comes just after he hostname, as in:  www.domain.com/parameter  For this reason, I've set the following rewriteRule, for two parameter values that I'd like to operate with:  RewriteRule ^(en|pt)$ /index.php?language=$1&amp;%{QUERY_STRING} [L]   Works fine! Although, I need to create a new rule, to redirect any request without one the parameters listed.  For that reason, I thought this would work:  RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !^(en|pt)$ RewriteRule ^(.*)$ /pt/$1/ [L,R=301]   But unfortunately is showing a redirect loop.  I've been getting:  http://hostname/pt/pt/pt/pt/pt/pt/pt/pt/pt/pt/pt/pt/pt/pt/pt/pt/pt/pt/pt/pt/pt//   Any tips on how to fix this are appreciated!
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.
"You're too clever a man" I have a Sony VAIO S series with Windows 8 preinstalled, and I installed Ubuntu 12.10 on a new partition. When the PC boots Grub is display, and I can choose between Windows 8 (didn't worked at the beginning, had to change Grub settings) and Ubuntu 12.10. When I select Ubuntu 12.10 everything is OK, but when I use Windows 8, and I restart Grub isn't displayed anymore (Windows 8 boots immediately).  I booted a Ubuntu 12.10 LiveUSB, used efibootmgr, and found out that Windows 8 (each time it boots) changes EFI default bootloader from Grub to Windows Boot Manager.  How do I change this in Windows 8? I read something about bcdedit, but it does not work or I don't know how to use it... Sarrus Rule with LaTeX Is there a way to create a new command with 9 arguments ({a_{11}},{a_{12}},{a_{13}},{a_{21}},{a_{22}},{a_{23}},{a_{31}},{a_{32}},{a_{33}}) that has as output a matrix with the Sarrus Rule? For instance: to obtain     just use the command that we will call sarrus:  \sarrus{-k}{k-1}{1}{0}{k-1}{k}{2}{0}{1}.   If it is possible i want to use the command sarrus in math mode just like matrix for istance. Overfull box and broken pagination with page that contains only section headings I'm using the Apache Commons EqualsBuilder to build the equals method for a non-static Java inner class. For example:  import org.apache.commons.lang.builder.EqualsBuilder;  public class Foo {     public class Bar {         private Bar() {}          public Foo getMyFoo() {             return Foo.this         }          private int myInt = 0;          public boolean equals(Object o) {             if (o == null || o.getClass() != getClass) return false;              Bar other = (Bar) o;             return new EqualsBuilder()                 .append(getMyFoo(), other.getMyFoo())                 .append(myInt, other.myInt)                 .isEquals();         }     }      public Bar createBar(...) {         //sensible implementation     }      public Bar createOtherBar(...) {         //another implementation     }      public boolean equals(Object o) {         //sensible equals implementation     } }   Is there syntax by which I can refer to other's Foo reference apart from declaring the getMyFoo() method? Something like other.Foo.this (which doesn't work)? Was Stack Exchange named after Experts Exchange? Was Stack Exchange named after Experts Exchange, or is the former using the word "Exchange" a coincidence? Suppose k is an integer such that $6k + 1$, $12k + 1$, $18k + 1$ are primes. Show that $n = (6k + 1)(12k + 1)(18k + 1)$ is a Carmichael number.  This is a question on a past exam that I find difficulty to answer. Can anyone help? Implementing auto correct/complete on Stack Overflow I have a bash script that makes a cURL request and writes the output to a file called resp.txt.  I need to create an exclusive lock so that I can write to that file and not worry about multiple users running the script and editing the text file at the same time. Here is the code that I expect to lock the file, perform the request, and write to the text file: ( flock -e 200 curl 'someurl' -H 'someHeader' &gt; resp.txt ) 200&gt;/home/user/ITS/resp.txt  Is this the correct way to go about this?  My actual script is a bit longer than this, but it seems to break when I add the flock syntax to the bash script. If someone could explain how these file descriptors work and let me know if I am locking the file correctly that would be awesome! What's the full-form & significance of USS & ISS prefixes in name of Star Trek starships? In the Star Trek normal universe, almost all of Starfleet's starships were named with the prefix USS: Count from . Some popular ones: USS Enterprise - series, USS Stargazer, USS Exeter, USS Defiant, USS Excelsior, USS Voyager, USS Titan, USS Reliant, USS Equinox, USS Grissom, USS Relativity, etc.  In the mirror universe, Starfleet's starships were named with the prefix ISS. We don't have a big list, but we do see these: ISS Enterprise NX-01, ISS Enterprise NCC-1701, ISS Avenger.  What's the full form of USS &amp; ISS in Star Trek canon?  In the real world, the US Navy uses USS in ship names, which is reasonable as "United States Ship", but why is it used in Star Trek canon (in which there's no US to control starships)?  In the mirror universe, USS is replaced with ISS. Why? Does ISS have a meaning opposite from that of USS? How to study/prepare for the Salesforce Developer Certification I am fairly new to Force.com development (less than a year). I did not learn it from the ground up. So I think it will be good to study for the developer exam to strengthen my basics and improve my overall knowledge of Force.com + it will be great to have this certification.  Now it's surprising that there is not a lot of great information on the web about how to go about obtaining this certification. Most other major certifications have dedicated study guide books available but there are few for Force.com and I don't think any of them are official.   The official page has little information. The Study guide gives a broad description of the topics in the test.   I see a lot of the esteemed members are here certified developers. I think if you guys could give us a little information, hints/tips and some advice on how to prepare for this exam, it will really be of great help. Also is DEV401 required/helpful?  Also if we could get recommendations for great resources(books, online training etc) and practice tests it will be awesome. Can blender use the Alpha channel of an image as transparency on a plane? What would be the best approach to get the recordtype id Can anyone identify this 90s teen-fantasy series, gems in backbone, big magic, evil king? I'm not a physicist; I'm just curious about what would happen.  According to this video "" (at 2:50):     "Somebody decided to leave the detectors on but just not take any data. [...] So if it was also going to a magnetic tape - there was no magnetic tape loaded. [...] And what do you think happed? They got this. They got the diffraction pattern."   So the act of measuring (beeing concious of the data) destroys wave-form pattern?  If so lets consider these cases:   What if I'd throw a dice after the experiment to decide if I should look at the data or to destroy it? (e.g. look at the data if the number on dice is even) What if the information about measurement would need to travel longer period of time than the particle would need to hit the wall?    To above cases: Would it mean that information travelled instantly - faster than light or that "the particle can look into the future"? PHP Codes are displaying in HTML How to interpret Vgs(th) min/max in a MOSFET datasheet? This is a screenshot of IRF9640 MOSFET datasheet. Will you please tell me, what is meant by max and min value of Vgs threshold voltage. Also what they mean by test condition.  Whether the max and min values are only applicable for specified test condition? What will be the threshold voltage for a switching circuit and how the range varies?  My doubt is, for p channel mosfet to turn on Vgs &lt; Vgs(th). For IRF9640 in what volt it will turn on -3 or -5? When i used in my application Vs is 6v and Vg is 3v hence Vgs=-3v but it won't turned on, Why? It turned on when Vgs=-3.3v.  If we consider -2v as threshold, it should turn on when Vgs=-3v. Why they given a range for threshold voltage. Whether we have to test each mosfet to know their threshold. What i am pointing is that, if we have two IRF9640, will Vgs(th) is differ from each other? Finding information on German soldiers from World War I and World War II? Permission denied, are you root? I get this error whenever I try to install programs using the terminal:  home@ubuntu:~$ apt-get install myunity E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?   Also I'm unable to install updates using the terminal. Best book of topology for beginner? I am a graduate student of math right now but I was not able to get a topology subject in my undergrad... I just would like to know if you guys know the best one..