.htaccess RewriteRule should mask URL, but redirects visibly insteadGeneric htaccess redirect www to non-wwwTips for debugging .htaccess rewrite rulesWhat will be the rewriterule to redirect when query is not a valid directory.htaccess URL masking instead of redirectingRewriteRule for first directory in URL onlyRedirect url and mask domain using htaccess.htaccess 301 redirect not working - tried Redirect, RewriteMatch, RewriteRulehtaccess RewriteRule doesn't work properly if no trailing slash.htaccess RewriteRule to mask url to fileLaravel htaccess, redirect url if find /en

What is this arch-and-tower near a road?

Why did C++11 make std::string::data() add a null terminating character?

List of Implementations for common OR problems

Why did the "Orks" never develop better firearms than Firelances and Handcannons?

Motorcyle Chain needs to be cleaned every time you lube it?

CPA filed late returns, stating I would get money; IRS says they were filed too late

What do you call the angle of the direction of an airplane?

How to deal with administrative duties killing the research spirit?

Is there a typical layout to blocking installed for backing in new construction framing?

How to calculate a conditional PDF in mathematica?

Did Stalin kill all Soviet officers involved in the Winter War?

Has chattel slavery ever been used as a criminal punishment in the USA since the passage of the Thirteenth Amendment?

How can I effectively map a multi-level dungeon?

Is it possible that Curiosity measured its own methane or failed doing the spectrometry?

Sleepy tired vs physically tired

Do the 26 richest billionaires own as much wealth as the poorest 3.8 billion people?

How should I present a resort brochure in my general fiction?

How to improve the size of cells in this table?

Can 4 Joy cons connect to the same Switch?

Why does the Batman "crack his knuckles" in "Batman: Arkham Origins"?

What can a novel do that film and TV cannot?

Explain how 'Sharing the burden' puzzle from Professor Layton and the Miracle Mask should be solved

My players like to search everything. What do they find?

Finding sum of divisors of numbers between the range (1 to 1e16)



.htaccess RewriteRule should mask URL, but redirects visibly instead


Generic htaccess redirect www to non-wwwTips for debugging .htaccess rewrite rulesWhat will be the rewriterule to redirect when query is not a valid directory.htaccess URL masking instead of redirectingRewriteRule for first directory in URL onlyRedirect url and mask domain using htaccess.htaccess 301 redirect not working - tried Redirect, RewriteMatch, RewriteRulehtaccess RewriteRule doesn't work properly if no trailing slash.htaccess RewriteRule to mask url to fileLaravel htaccess, redirect url if find /en






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I'm making a hard-coded list of a few Google-friendly "pretty URLs" to be rewritten to the actual messy URLs. We want the messy URLs to stay masked--so we don't want 301 redirects.



The pretty URLs are all in the form domain.com/buy/item-name, and the destination URLs are all pages in the domain root (PHP with parameters).



Our test case that fails:



domain.com/buy/test should mask to domain.com/content.php?do=123



Since /buy was never a real directory, I created it and am using the following .htaccess file within it. (This allows the current .htaccess work to be kept separate from the root .htaccess, and is a model we could follow with other directories in future.)



Thus, all we intend do is detect "test" (and other phrases within /buy) and mask that to the root page /content.php?do=123.



The /buy directory's entire .htaccess file is:



RewriteEngine On

RewriteRule ^test/?$ /content.php?do=123 [L]


That test RewriteRule connects to the destination just fine--but does not mask. The browser shows the unwanted messy URL.



Why? My only thought is: could there be something in the hosting company's default .htaccess at the root level which forces all RewriteRules to be redirects? If that's even possible, what should I look for there?



Thanks for any leads!










share|improve this question




























    0















    I'm making a hard-coded list of a few Google-friendly "pretty URLs" to be rewritten to the actual messy URLs. We want the messy URLs to stay masked--so we don't want 301 redirects.



    The pretty URLs are all in the form domain.com/buy/item-name, and the destination URLs are all pages in the domain root (PHP with parameters).



    Our test case that fails:



    domain.com/buy/test should mask to domain.com/content.php?do=123



    Since /buy was never a real directory, I created it and am using the following .htaccess file within it. (This allows the current .htaccess work to be kept separate from the root .htaccess, and is a model we could follow with other directories in future.)



    Thus, all we intend do is detect "test" (and other phrases within /buy) and mask that to the root page /content.php?do=123.



    The /buy directory's entire .htaccess file is:



    RewriteEngine On

    RewriteRule ^test/?$ /content.php?do=123 [L]


    That test RewriteRule connects to the destination just fine--but does not mask. The browser shows the unwanted messy URL.



    Why? My only thought is: could there be something in the hosting company's default .htaccess at the root level which forces all RewriteRules to be redirects? If that's even possible, what should I look for there?



    Thanks for any leads!










    share|improve this question
























      0












      0








      0








      I'm making a hard-coded list of a few Google-friendly "pretty URLs" to be rewritten to the actual messy URLs. We want the messy URLs to stay masked--so we don't want 301 redirects.



      The pretty URLs are all in the form domain.com/buy/item-name, and the destination URLs are all pages in the domain root (PHP with parameters).



      Our test case that fails:



      domain.com/buy/test should mask to domain.com/content.php?do=123



      Since /buy was never a real directory, I created it and am using the following .htaccess file within it. (This allows the current .htaccess work to be kept separate from the root .htaccess, and is a model we could follow with other directories in future.)



      Thus, all we intend do is detect "test" (and other phrases within /buy) and mask that to the root page /content.php?do=123.



      The /buy directory's entire .htaccess file is:



      RewriteEngine On

      RewriteRule ^test/?$ /content.php?do=123 [L]


      That test RewriteRule connects to the destination just fine--but does not mask. The browser shows the unwanted messy URL.



      Why? My only thought is: could there be something in the hosting company's default .htaccess at the root level which forces all RewriteRules to be redirects? If that's even possible, what should I look for there?



      Thanks for any leads!










      share|improve this question














      I'm making a hard-coded list of a few Google-friendly "pretty URLs" to be rewritten to the actual messy URLs. We want the messy URLs to stay masked--so we don't want 301 redirects.



      The pretty URLs are all in the form domain.com/buy/item-name, and the destination URLs are all pages in the domain root (PHP with parameters).



      Our test case that fails:



      domain.com/buy/test should mask to domain.com/content.php?do=123



      Since /buy was never a real directory, I created it and am using the following .htaccess file within it. (This allows the current .htaccess work to be kept separate from the root .htaccess, and is a model we could follow with other directories in future.)



      Thus, all we intend do is detect "test" (and other phrases within /buy) and mask that to the root page /content.php?do=123.



      The /buy directory's entire .htaccess file is:



      RewriteEngine On

      RewriteRule ^test/?$ /content.php?do=123 [L]


      That test RewriteRule connects to the destination just fine--but does not mask. The browser shows the unwanted messy URL.



      Why? My only thought is: could there be something in the hosting company's default .htaccess at the root level which forces all RewriteRules to be redirects? If that's even possible, what should I look for there?



      Thanks for any leads!







      apache .htaccess mod-rewrite






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 25 at 18:38









      adamsimadamsim

      1064 bronze badges




      1064 bronze badges






















          0






          active

          oldest

          votes










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55344451%2fhtaccess-rewriterule-should-mask-url-but-redirects-visibly-instead%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes




          Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







          Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid …


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55344451%2fhtaccess-rewriterule-should-mask-url-but-redirects-visibly-instead%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          How to preserve electronics (computers, tablets and phones) for hundreds of years Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) The network's official Twitter account is up and running again. What content…How might modern humans leave a message for 50,000 years?How would an aquatic race develop computers?How do we make computers care for human life?Keeping supplies for 1000 yearsWhat will cell phones become in 100 years?What body armor protects against a laser?Could a society attain 1800s technology if limited to using copper and bronze?Electricity power (magic) and electronicsScavenging metal resources in post-apocalypse after 100 yearsWhy would precursors create devices that can survive and still work after hundreds of years?

          155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해

          Convert JSON to MapSimplest way to convert a string representing JSON array into Java array List of key value pairsHow to take String JSON values into HashMapConvert a JSON String to a HashMapCreating BSON object from JSON stringJSONObject - How to get a value ?Better Map ConstructorReading JSON from Url javaUpdate columns if input values are not null otherwise ignore and keep the existing values of column in databaseHow to store object represented as Json string into Couchbase Lite?Go JSON into MapHow do I efficiently iterate over each entry in a Java Map?Sort a Map<Key, Value> by valuesHow to round a number to n decimal places in JavaCan comments be used in JSON?How do I read / convert an InputStream into a String in Java?How can I pretty-print JSON in a shell script?What is the correct JSON content type?How can I deserialize JSON to a simple Dictionary<string,string> in ASP.NET?Why does Google prepend while(1); to their JSON responses?Parse JSON in JavaScript?