I am using the following .htaccess file, which works well, however, I want to also forward any attempts to access non-existent files in the root directory and in any subdirectory (whether the subdirectory exists or not) back to the main domain name.   I tried FallbackResource but that resulted in 500 series errors.  RewriteEngine On  RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^https://xxxxxxxxx.xxxxx/.*$ [NC] RewriteRule \.(gif|jpg|jpeg|bmp|zip|rar|mp3|flv|swf|png|css|pdf)$ -     [F]  # browser requests PHP RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^\ ]+)\.php RewriteRule ^/?(.*)\.php$ /$1 [L,R=301]  # check to see if the request is for a PHP file: RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^/?(.*)$ /$1.php [L]  ErrorDocument 500 /redirect ErrorDocument 500 /redirect ErrorDocument 500 /redirect ErrorDocument 404 /error ErrorDocument 401 /redirect ErrorDocument 403 /redirect   Any help would be greatly 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.
How to change the Google Chrome default print margins In Chrome, the default print margins are narrow. I would like the default to be wider.  Is there a way to make them wider? Meaning of 'const' last in a function declaration of a class? How do I set a background image while I am editing? How do I put a backdrop behind the model that I am creating so that I can compare the picture to the model while editing? A inequality proposed at Zhautykov Olympiad 2008 An inequality proposed at Zhautykov Olympiad 2008.     Let be $a,b,c &gt;0$ with $abc=1$. Prove that:    $$\sum_{\mathrm{cyc}}{\frac{1}{(a+b)b}} \geq \frac{3}{2}.$$   Set $a=\frac{x}{y}$, $b=\frac{y}{z}$, $c=\frac{z}{x}$.   Our inequality becomes: $$\sum_{\mathrm{cyc}}{\frac{z^2}{zx+y^2}} \geq \frac{3}{2}.$$  Now we use that: $z^2+x^2 \geq 2zx.$ $$\sum_{\mathrm{cyc}}{\frac{z^2}{zx+y^2}} \geq \sum_{\mathrm{cyc}}{\frac{2z^2}{z^2+x^2+2y^2}} \geq \frac{3}{2}.$$  Now applying Cauchy-Schwarz we obtain the desired result.  What I wrote can be found on this link: . But now, I don't know how to apply Cauchy-Schwarz.   Thanks:) I just want to know if it's possible to get Cain and abel installed in ubuntu, it would really help my work instead of dual booting back to my windows 7 just to use it. THanks! If photon energies are continuous and atomic energy levels are discrete, how can atoms absorb photons? If photon energies are continuous and atomic energy levels are discrete, how can atoms absorb photons? The probability of a photon having just the right amount of energy for an atomic transition is $0$. Stuck on two valid squares in minesweeper How to solve? The 1 indicates that ones of the two questioned flags is a mine and 3 also indicates the same. How to choose logically between any one of them? How can you find out which process is listening on a TCP or UDP port on Windows? Rewriting Triple Integral in different order How can I rewrite, say: $$\int^1_0\int^{z^2}_0\int^y_0{f}dxdydz$$ In the orders $dzdxdy$ and $dydzdx$?  Would I have to solve this triple integral all the way or is there a simple way to do this? It looks like this issue has , but it just happened again on Travel.SE. Perhaps this is another corner case? These two questions are closed as duplicates of each other.           I had the last vote on each, although in both cases, my vote was for "Unclear what you're asking", but the weight of votes in both cases were for the duplicate status. So if the existing checks are only in place at the time someone casts a close vote, that would explain how this one got in under the radar. Perhaps another check needs to be done when the question is actually closed, not just when close votes are cast?  And as @gnat points out, low-rep/logged-out users get a Redirect loop when trying to load either question.  NOTE: A moderator has already fixed this particular circular duplicate situation by closing one of the questions with a different close reason. This question arises when I try to describe my itinerary to ticket service in the UK. Take for example, I plan to buy a ticket from A to B. B is the terminal. How to say its counter part A? I cannot find a proper term. I have to say "I will depart from A" or "I plan to go to B from A". Or I even use "departure place" to refer to B. I have downloaded and extracted the packet tracer file, then I used this command as root  chmod +x install   then I ran (as root)  ./install    Then I used this command   ./set_ptenv.sh   but whenever I run this command   packettracer    it just doesn't start I've started putting into practice the answer to . Yet I would like to change this so that there are brackets around the citations:   in the superscript in text,     in the superscript in footnote,  in the bibliography.   I've managed to get the first one and the last one working. The second one however, I don't know how to do this.   Note that I mainly write in english and in dutch, so I don't think there is much babel interference.  Also, would there be a way to order the footnotes so that first all ''normal'' \footnote{} are printed and below that all \sfcite{} citational footnotes (per page that is)?  Here's what I've managed to concoct:  \documentclass{article} \usepackage[english]{babel} \usepackage[pdfborder={0 0 0}]{hyperref} \usepackage[citestyle=numeric-comp,sorting=none,hyperref]{biblatex} \usepackage{filecontents}  % No brackets around the number of each bibliography entry \DeclareFieldFormat{labelnumberwidth}{\textbf{[#1]}}  %--------------------------------------------------------------- % Essentially verbatim from Joseph Wright % http://www.texdev.net/2010/03/08/biblatex-numbered-citations-as-footnotes/ \makeatletter \ExecuteBibliographyOptions{citetracker,sorting=none}  \DeclareCiteCommand{\notefullcite}[\mkbibbrackets]     {\usebibmacro{cite:init}%         \usebibmacro{prenote}}     {\usebibmacro{citeindex}%         \usebibmacro{notefullcite}%         \usebibmacro{cite:comp}}     {}     {\usebibmacro{cite:dump}%         \usebibmacro{postnote}}  \newbibmacro*{notefullcite}{%     \ifciteseen         {}         {\footnotetext[\thefield{labelnumber}]{%             \usedriver{}{\thefield{entrytype}}\addperiod}}}  \DeclareCiteCommand{\sfcite}[\cbx@superscript]%     {\usebibmacro{cite:init}%         \let\multicitedelim=\supercitedelim         \iffieldundef{prenote}         {}         {\BibliographyWarning{Ignoring prenote argument}}%     \iffieldundef{postnote}         {}         {\BibliographyWarning{Ignoring postnote argument}}}     {\usebibmacro{citeindex}%         \usebibmacro{sfcite}%         \usebibmacro{cite:comp}}     {}     {\usebibmacro{cite:dump}}  \newbibmacro*{sfcite}{%     \ifciteseen         {}         {\xappto\cbx@citehook{%             \noexpand\footnotetext[\thefield{labelnumber}]{%             \fullcite{\thefield{entrykey}}\addperiod}}}}  \newrobustcmd{\cbx@superscript}[1]{%     \mkbibsuperscript{[#1]}%     \cbx@citehook     \global\let\cbx@citehook=\empty} \let\cbx@citehook=\empty \makeatother %---------------------------------------------------------------  \begin{filecontents}{\jobname.bib} @article{ref1,     hyphenation = {american},     title = {Natural Products as Sources of New Drugs over the Last 25 Years},     author = {Newman, D.J. and Cragg, G.M.},     journal = {J. of Nat. Prod.},     volume = {70},     number = {3},     pages = {461--477},     year = {2007}} @article{ref2,     hyphenation = {american},     title = {Natural products as leads to potential drugs: an old process or the new hope for drug discovery?},     author = {Newman, D.J.},     journal = {J. of Med. Chem.},     volume = {51},     number = {9},     pages = {2589--2599},     year = {2008}} @online{ref3,     author = {Quintin, C.},     title = {Les eponges},     url = {http://christophe.quintin.pagesperso-orange.fr/Liste_Doc.html},     urldate = {2009-05-03} } \end{filecontents}  \addbibresource{\jobname.bib}  \begin{document} First citation.\sfcite{ref1,ref2} Some text\footnote{A footnote}.   \pagebreak Second citation\sfcite{ref1}, second citation\sfcite{ref2}, first citation.\sfcite{ref3} \printbibliography \end{document} I try to add an item to my sharepoint list from a custom web part. Is there any mistake in my code?  [WebMethod]         public static string AjouterDemande()         {             SPList ListeDemandeConge = SPContext.Current.Site.RootWeb.Lists["DEMANDE CONGÉ"];             SPListItem ListItem = ListeDemandeConge.Items.Add();             ListItem["CODE"] = code;             ListItem["DEMANDEUR"] = Utilisateur.LoginName;             ListItem["DATE DEMANDE"] = DateTime.Today.Date;             ListItem["DATE FIN"] = EndDateD;             ListItem["DATE DEPART"] = StartDateD;             ListItem["DUREE"] = int.Parse(DayCount);             ListItem["PREMIER RESPONSABLE"] = Employe.FirstSuperior.LoginName;             ListItem["DEUXIEME RESPONSABLE"] = Employe.SecondSuperior.LoginName;             ListItem["PRESENCE PRES"] = Boolean.Parse(FirstRespPresent);             ListItem["SOLDE CONGE"] = Conge.SoldeAnneeConge;             ListItem["MOIS"] = int.Parse(StartDateTab[1]);             ListItem["ANNEE"] = int.Parse(StartDateTab[0]);             ListItem["JOURS APPROUVEES"] = 0;             ListItem.Update();             ListeDemandeConge.Update();             return "true";          }   When I use F10 to process debugging step by step and get to my listitem.update(), it went out without giving any error. What is the pronunciation of the possessive words that already end in s? Possible Duplicate:           My name is Greg — this is Greg 's post.  If my name ended with an 's', I am aware of the proper apostrophe usage (James&nbsp;→ James'), but how should this be pronounced?  Phonetically, am I Jameses best friend or James best friend? Flying Turkish Airlines, what are credit card rules? I have return tickets flying out of SFO on Turkish airlines for the whole family. The credit card I used to book the tickets has since been replaced by the bank with a new card.   In order to board, can I present the new credit card (same name) at the checkin counter, or must I present the original credit card (which is no longer valid and has been discarded)?  By 'discarded' - I mean cut up and thrown away in trash. It was no longer valid, since it was replaced with a new card. So can I use the new card to travel on a booking that was made using the original card?    The new card has a new number; and the ticket was purchased through an agent. Where to put my code: plugin or functions.php? In Delphi, is TDataSet thread safe? I'd like to be able to open a TDataSet asynchronously in its own thread so that the main VCL thread can continue until that's done, and then have the main VCL thread read from that TDataSet afterwards. I've done some experimenting and have gotten into some very weird situations, so I'm wondering if anyone has done this before.  I've seen some sample apps where a TDataSet is created in a separate thread, it's opened and then data is read from it, but that's all done in the separate thread. I'm wondering if it's safe to read from the TDataSet from the main VCL thread after the other thread opens the data source.  I'm doing Win32 programming in Delphi 7, using TmySQLQuery from  as my TDataSet descendant. I asked this question for many people/professors without getting a sufficient answer, why in QM Lebesgue spaces of second degree are assumed to be the one that corresponds to the Hilbert vector space of state functions, from where this arises? and why 2-order space that assumes the following inner product:  $\langle\phi|\psi\rangle =\int\phi^{*}\psi\,dx$  While there is many ways to define the inner product.  In Physics books, this always assumed as given, never explains it, also I tried to read some abstract math books on this things, and found some concepts like "Metric weight" that will be minimized in such spaces, even so I don't really understand what is behind that, so why $L_2$? what special about them? Who and how physicists understood that those are the one we need to use? Analogue of spherical coordinates in $n$-dimensions What's the analogue to spherical coordinates in $n$-dimensions? For example, for $n=2$ the analogue are polar coordinates $r,\theta$, which are related to the Cartesian coordinates $x_1,x_2$ by  $$x_1=r \cos  \theta$$ $$x_2=r \sin  \theta$$  For $n=3$, the analogue would be the ordinary spherical coordinates $r,\theta ,\varphi$, related to the Cartesian coordinates $x_1,x_2,x_3$ by  $$x_1=r \sin  \theta  \cos  \varphi$$ $$x_2=r \sin  \theta  \sin  \varphi$$ $$x_3=r \cos  \theta$$  So these are my questions: Is there an analogue, or several, to spherical coordinates in $n$-dimensions for $n&gt;3$? If there are such analogues, what are they and how are they related to the Cartesian coordinates? Thanks.