The originally intended title exceeds the limit; it is, "Why is a URL shortener rewriting  to  when I want  forwarded to ?"  I posted below a question asked after long using Apache URL rewriting (from 1.3.x when 2.0 wasn't around). A quick check shows my /etc/apache2/sites-enabled to have 121 RewriteRules, including site relocation, switching from HTTP to HTTPS, and other workhorses. I'm also having trouble with a very simple task, simple as putting a RewriteRule to move something to another URL without breaking links or causing the old location to be a 404 error.  I also sanitized servers and identifiers, not because I'm relucant to give this specific raw data, but in an attempt at politeness, partly to avoid spam, and partly because someone can always ask to see the real data.  I have, modulo removing comments and hiding masking e.g. domain names, the following Apache VirtualHost:  &lt;VirtualHost *:80>         ServerAdmin cjshayward@pobox.com         DocumentRoot /home/jonathan/stornge         ServerName cjsh.name         ServerAlias www.cjsh.name         LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" combined         CustomLog /home/jonathan/logs/stornge.com combined         RewriteEngine on         #RedirectMatch ^/$ https://cjshayward.com/books/         RewriteRule ^/$ https://CJSHayward.com/books/ [R=301,L]         RewriteRule ^$ https://CJSHayward.com/books/ [R=301,L]         RewriteRule ^/([^?].*)$ http://stornge.com/?$1 [R=301,L]         #RewriteRule ^.*/writings/autobiography/(.*)$ /about/author/ [R=301,L]         #RewriteRule ^/tiki.*$ http://www.facebook.com/pages/CJS-Hayward/9506801167 [R=301,L]         #RewriteRule ^/community/tiki.*$ http://www.facebook.com/pages/CJS-Hayward/9506801167 [R=301,L]         &lt;Directory /home/jonathan/stornge/>             Options ExecCGI Indexes FollowSymLinks MultiViews             AllowOverride None             Order allow,deny             allow from all         &lt;/Directory> &lt;/VirtualHost>  I'm not sure this is anywhere near optimal; the reasons for involving two servers (for an external site not hosted on either server, three) are mostly historical that could be improved on.  However, I want  to redirect to , and every time I load the homepage at , I am redirected to the homepage for  as a whole.  I can put the URI referral script in a pastebin if others want to see it, but I put what was meant as a "redirect from homepage" URL shortener:  #!/usr/bin/python   import cgi import cPickle import os import re import sys  if (os.getenv('HTTP_HOST') in ['cjsh.name', 'www.cjsh.name', 'stornge.com',   'www.stornge.com' and os.getenv('REQUEST_URI') ==   os.getenv('SCRIPT_NAME')):     print '''Status 301 Moved Permanently Location: https://CJSHayward.com/books/ Content-Type: text/html; charset=UTF-8  &lt;a href="https://CJSHayward.com/books/">Go to bookstore.&lt;/a>'''     sys.exit(0)  I've tried a couple of ways of working around it, with clearing caches, switching between browsers, and using (sub)domains I haven't really used for anything else; I don't really use a FQDN of  unless I was trying to circumvent caching expected in .  I do not consider this question to be, "How do you get things basically working with URLs and get work done," but "Why do my quite numerous attempts to redirect  to  end up at the  homepage? These are two very different questions, so far as I know.
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.
I went to the doctor's I have run across such a sentence:     Yesterday I was ill, so I went to the doctor's.   What is the function of possessive here, that is doctor's? Why does an unhinged body rotate about its centre of mass? If a force is applied to a body which does not act through its centre of mass, it rotates about its centre of mass and not any other point. Why? Double dual mappings $\newcommand{\Hom}{\operatorname{Hom}}$Let $U,V$ be vector spaces. Denote the dual space of $U$ with $U^\intercal$ and the dual mapping of a linear map $\Phi$ be $\Phi^\intercal$. Define the double dual embedding on $U$ to be $\iota_U:U \to U^{\intercal\intercal}$. ($u \in U, f \in U^\intercal$) $$ \iota_U(u)(f) = f(u) $$     If $\Phi \in \Hom(V,U)$, then $\Phi^{\intercal\intercal} \circ \iota_V = \iota_U \circ \Phi:V \to U^{\intercal\intercal}$   Proof: Let $v \in V, f \in U^\intercal$. Then $$ \iota_U \circ \Phi(v)(f) = f(\Phi(v)) $$ but how do I show that $$ \Phi^{\intercal\intercal} \circ \iota_V(v)(f) = f(\Phi(v)) $$ ? How to resolve a Java Rounding Double issue Find out which process is locking a file or folder in Windows How to keep Heading together with text? I use a very custom style (not mine) and very frequently I get a heading  on the bottom of a page and the next paragraph on the top of the next page. Sometimes this paragraph may be a list or similar. The same is true for listings and the listing description.   Is there a general way how I can adjust the "badness" of these events? Or can I adjust when a section heading would be on the last, say, 3cm of a page it should go to the next page? Or can I say, if a *listing description" is on the top 3cm of a page pull 5 more listing lines from the last page onto this page?   The style I use does not use standard structure tags and environments. But lets call them section, subsection, listing and I will try to migrate them to my lingo. What is numeric promotion? What is `$?` ? Is it a variable? The question is pretty straight forward. I can get the exit code of the previous command by using $?. But what exactly is it?  I don't think it is a variable, because you can't have any special characters in the name of variable other than _.  foo?foo=10   will result in the error: foo?foo=10: command not found  So if it is not a variable, what is it? Are there others like it? How do I correct an HSA distribution when I was refunded by a health provider? Why do I get (author?) when I use \citet with natbib? I would like to show the author names using \citet but I get just the reference number. Here is a minimal code:  \documentclass{report} \usepackage[utf8]{inputenc} \usepackage[english]{babel} \usepackage{natbib}  \begin{document}   The author \citet{toschi09} has shown that ..  \bibliographystyle{plain} \bibliography{foo}  \end{document}   And here is foo.bib  @article{toschi09, author = {Toschi, F. and Bodenschatz, E.}, title = {Lagrangian Properties of Particles in Turbulence}, journal = {Annual Review of Fluid Mechanics}, volume = {41}, number = {1}, pages = {375-404}, year = {2009},  }   What I get is:     The author (author?) [1] has shown that ..   Any help will be more than welcome, thank you! Can compact sets completey determine a topology? Suppose that $\tau_1$ and $\tau_2$ are two topologies on a set $X$ with the property that $K\subset X$ is compact with respect to $\tau_1$ if and only if $K$ is compact with respect to $\tau_2$. Then is this enough information to determine whether $\tau_1 = \tau_2$?  If not (which is suspect to be the case) is there a nice counterexample, and what is the minimum amount of extra information required for $\tau_1 = \tau_2$?  I feel like there would be an issue regarding 'points at infinity.' Equivalent of shell 'cd' command to change the working directory? cd is the shell command to change the working directory. How do I change the current working directory in Python? How do I resolve these unmet dependencies? iCloud has sucked up all my laptop's files - can you transfer files directly from iCloud to Google Drive? I'm trying to disconnect my macbook from iCloud, as it's been creating some problems.  I was told by an Apple Support employee that doing so is only recommended once you've backed up everything from your Mac somewhere, to ensure you don't lose any files - so my goal is to upload everything to Google Drive before messing with my laptop's iCloud settings. The problem is, almost none of the projects that I want to back up to Google Drive are truly on my laptop - instead I mostly just have folders full of file names, which are placeholders for the real files that have been sucked into iCloud. This means I have to re-download everything to my computer before uploading it all to Google Drive. Another crucial piece of information is that I only have 1 GB of storage left on my macbook, which prevents me from re-downloading any complete projects/folders at a time. So unfortunately my current method is this: downloading 1-5 files at a time, uploading these few things to Google Drive, deleting the copies from my laptop and trash, repeat (thousands of times). So, I was wondering if anyone could offer any alternative methods for uploading stuff to Google Drive in this situation - for example, is there a way to transfer files directly from iCloud to Google Drive without having to download them to my laptop first? I should probably mention that I've scoured my laptop for duplicated files and applications I no longer use, make sure to empty my trash regularly, etc (I also asked Apple Support to help me make sure I wasn't missing out on any other ways to maximize storage space). The most obvious culprit of my lack of space is the massive 150 GB iCloud folder on my laptop, which appears to contain duplicates of everything on my computer. I can't seem to do anything about it until I've disconnected from iCloud itself (its reasons for existence are unclear to me in the first place...but that's beside the point lol). Definition respective derivation of angular momentum formula I am reading An Introduction to Mechanics by Kleppner and Kolenkow (2014). On page 241 is the definition of the :      Here is the formal definition of the angular momentum $\vec{L}$ of a particle that has momentum $\vec{p}$ and is at position $\vec{r}$ with respect to a given coordinate system: $$\vec{L}=\vec{r} \times \vec{p}$$   In the book there is no explanation why this formula should be true. From this equation the formulas for torque and moment of inertia are derived.   My question is: Why is the formula above correct? Why isn't the formula for angular momentum something completely different, like $\vec{L}=\sqrt{(\vec{r} \times \vec{p})2\pi M}$? Is the formula for angular momentum just a mere definition and if not, how to derive it? How did people come across that particular formula? How can I get the source directory of a Bash script from within the script itself? I've tried everything I can think of. Resetting the router, changing the channel number and band.   The internet connection is fine, and then just hangs for a minute or 2, then returns to normal.   The wifi icon remains connected, and I have the latest 10.10.4 update installed. At first I thought it was a DNS bug with Yosemite, and have played with the settings such as changing DNS provider, changing the IPV6 to IPV4 only etc.  Driving me nuts. Has anyone had a similar problem? I've checked the surroundings with wifi scanners and have chosen the best channel available.     One thing I have noticed, it seems a lot more reliable on 5GHz as opposed to 2.4Ghz It seems to affect my Macbook Pro Retina 13in Early 2015 a lot more than the other devices on the network. I'm using a Virginmedia  1. Prove that $\left (\frac{a^2 + b^2 +c^2}{a+b+c} \right) ^ {(a+b+c)} > a^a b^b c^c$ Prove that $\left (\dfrac{a^2 + b^2 +c^2}{a+b+c} \right) ^ {(a+b+c)} &gt; a^a b^b c^c$ if $a$, $b$ and $c$ are distinct natural numbers.  Is it possible using induction? Please provide me with the guidance to install oracle 11gr2 on Ubuntu 14.04. \@seccntformat only for section I would like to add a dot between the number of the section and section name. I used   \makeatletter \renewcommand*{\@seccntformat}[1]{% \csname the#1\endcsname .} \makeatother   The problem is that, obviously, it put a dot also among subsection number and subsection name which I do not want. Is it possible to add the dot only between section number and section using low level instructions i.e. without any additional package?