<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Apache RewriteRule in Networking</title>
    <link>https://community.hpe.com/t5/networking/apache-rewriterule/m-p/4342692#M1749</link>
    <description>Looking for some help with what I would have though was a simple RewriteRule, but this is the first time I've had to do it. &lt;BR /&gt;&lt;BR /&gt;A few sites we have are all under a single context root, so:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.domain.com/root/site1" target="_blank"&gt;www.domain.com/root/site1&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://www.domain.com/root/site2" target="_blank"&gt;www.domain.com/root/site2&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://www.domain.com/root/site3" target="_blank"&gt;www.domain.com/root/site3&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I want users to be able to hit &lt;A href="http://www.domain.com/site1" target="_blank"&gt;www.domain.com/site1&lt;/A&gt; and be forwarded. If this can be done without changing the URL in the browser then even better. &lt;BR /&gt;&lt;BR /&gt;I've got as far as:&lt;BR /&gt;&lt;BR /&gt;RewriteRule ^/(.*)$ /root/$1 [PT]&lt;BR /&gt;&lt;BR /&gt;This redirects the first page fine, but if you hit any links in the web page they obviously still have the original context root, so this rule adds /root to it again, and the page cannot be found:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.domain.com/root/site1/page1" target="_blank"&gt;www.domain.com/root/site1/page1&lt;/A&gt; becomes &lt;A href="http://www.domain.com/root/root/site1/page1" target="_blank"&gt;www.domain.com/root/root/site1/page1&lt;/A&gt; and 404s.&lt;BR /&gt;&lt;BR /&gt;I'm obviously missing something fundamental but mod-rewrite seems like a mine field. &lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;</description>
    <pubDate>Thu, 22 Jan 2009 09:12:01 GMT</pubDate>
    <dc:creator>RobinKing</dc:creator>
    <dc:date>2009-01-22T09:12:01Z</dc:date>
    <item>
      <title>Apache RewriteRule</title>
      <link>https://community.hpe.com/t5/networking/apache-rewriterule/m-p/4342692#M1749</link>
      <description>Looking for some help with what I would have though was a simple RewriteRule, but this is the first time I've had to do it. &lt;BR /&gt;&lt;BR /&gt;A few sites we have are all under a single context root, so:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.domain.com/root/site1" target="_blank"&gt;www.domain.com/root/site1&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://www.domain.com/root/site2" target="_blank"&gt;www.domain.com/root/site2&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://www.domain.com/root/site3" target="_blank"&gt;www.domain.com/root/site3&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I want users to be able to hit &lt;A href="http://www.domain.com/site1" target="_blank"&gt;www.domain.com/site1&lt;/A&gt; and be forwarded. If this can be done without changing the URL in the browser then even better. &lt;BR /&gt;&lt;BR /&gt;I've got as far as:&lt;BR /&gt;&lt;BR /&gt;RewriteRule ^/(.*)$ /root/$1 [PT]&lt;BR /&gt;&lt;BR /&gt;This redirects the first page fine, but if you hit any links in the web page they obviously still have the original context root, so this rule adds /root to it again, and the page cannot be found:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.domain.com/root/site1/page1" target="_blank"&gt;www.domain.com/root/site1/page1&lt;/A&gt; becomes &lt;A href="http://www.domain.com/root/root/site1/page1" target="_blank"&gt;www.domain.com/root/root/site1/page1&lt;/A&gt; and 404s.&lt;BR /&gt;&lt;BR /&gt;I'm obviously missing something fundamental but mod-rewrite seems like a mine field. &lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;</description>
      <pubDate>Thu, 22 Jan 2009 09:12:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/networking/apache-rewriterule/m-p/4342692#M1749</guid>
      <dc:creator>RobinKing</dc:creator>
      <dc:date>2009-01-22T09:12:01Z</dc:date>
    </item>
  </channel>
</rss>

