<?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 Re: apache + redhat + mod_rewrite in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/apache-redhat-mod-rewrite/m-p/4032931#M29149</link>
    <description>My file (rewrite.conf) looks like that:&lt;BR /&gt;&lt;BR /&gt;Header append P3P "CP=\"PHY DEM ONL STA NAV COM OUR CURi ADM DEV TAI CAO COR BUS DSP\""&lt;BR /&gt;RewriteEngine On&lt;BR /&gt;rewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.(php|html?)\ HTTP/&lt;BR /&gt;rewriteRule ^index\.(php|html?)$ &lt;A href="http://ttt.com/" target="_blank"&gt;http://ttt.com/&lt;/A&gt; [R=301,L]&lt;BR /&gt;#&lt;BR /&gt;rewriteCond %{HTTP_HOST} ^&lt;A href="http://www.ttt.com" target="_blank"&gt;www.ttt.com&lt;/A&gt;\.com&lt;BR /&gt;rewriteRule (.*) &lt;A href="http://ttt.com/$1" target="_blank"&gt;http://ttt.com/$1&lt;/A&gt; [R=301.L]&lt;BR /&gt;ErrorDocument 400 &lt;A href="http://ttt.com" target="_blank"&gt;http://ttt.com&lt;/A&gt;&lt;BR /&gt;ErrorDocument 401 &lt;A href="http://ttt.com" target="_blank"&gt;http://ttt.com&lt;/A&gt;&lt;BR /&gt;ErrorDocument 403 &lt;A href="http://ttt.com" target="_blank"&gt;http://ttt.com&lt;/A&gt;&lt;BR /&gt;ErrorDocument 404 &lt;A href="http://ttt.com" target="_blank"&gt;http://ttt.com&lt;/A&gt;&lt;BR /&gt;ErrorDocument 500 &lt;A href="http://ttt.com" target="_blank"&gt;http://ttt.com&lt;/A&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 29 Aug 2007 11:43:45 GMT</pubDate>
    <dc:creator>Piotr Kirklewski</dc:creator>
    <dc:date>2007-08-29T11:43:45Z</dc:date>
    <item>
      <title>apache + redhat + mod_rewrite</title>
      <link>https://community.hpe.com/t5/operating-system-linux/apache-redhat-mod-rewrite/m-p/4032927#M29145</link>
      <description>Hi there&lt;BR /&gt;There is something wrong with my apache:&lt;BR /&gt;&lt;BR /&gt;LoadModule rewrite_module modules/mod_rewrite.so&lt;BR /&gt;&lt;BR /&gt;And in vhost.conf :&lt;BR /&gt;&lt;BR /&gt;DocumentRoot /home/default/mysite.com/user/htdocs&lt;BR /&gt;&lt;BR /&gt;My .htaccess looks like that:&lt;BR /&gt;&lt;BR /&gt;eader append P3P "CP=\"PHY DEM ONL STA NAV COM OUR CURi ADM DEV TAI CAO COR BUS DSP\""&lt;BR /&gt;RewriteEngine On&lt;BR /&gt;rewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.(php|html?)\ HTTP/&lt;BR /&gt;rewriteRule ^index\.(php|html?)$ &lt;A href="http://loansloansloansuk.com/" target="_blank"&gt;http://loansloansloansuk.com/&lt;/A&gt; [R=301,L]&lt;BR /&gt;#&lt;BR /&gt;rewriteCond %{HTTP_HOST} ^&lt;A href="http://www.mysite.com" target="_blank"&gt;www.mysite.com&lt;/A&gt;\.com&lt;BR /&gt;rewriteRule (.*) &lt;A href="http://mysite.com/$1" target="_blank"&gt;http://mysite.com/$1&lt;/A&gt; [R=301.L]&lt;BR /&gt;ErrorDocument 400 &lt;A href="http://mysite.com" target="_blank"&gt;http://mysite.com&lt;/A&gt;&lt;BR /&gt;ErrorDocument 401 &lt;A href="http://mysite.com" target="_blank"&gt;http://mysite.com&lt;/A&gt;&lt;BR /&gt;ErrorDocument 403 &lt;A href="http://mysite.com" target="_blank"&gt;http://mysite.com&lt;/A&gt;&lt;BR /&gt;ErrorDocument 404 &lt;A href="http://mysite.com" target="_blank"&gt;http://mysite.com&lt;/A&gt;&lt;BR /&gt;ErrorDocument 500 &lt;A href="http://mysite.com" target="_blank"&gt;http://mysite.com&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;And rewriting is not working:&lt;BR /&gt;&lt;BR /&gt;Can anyone help ?&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 05 Jul 2007 10:57:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/apache-redhat-mod-rewrite/m-p/4032927#M29145</guid>
      <dc:creator>Piotr Kirklewski</dc:creator>
      <dc:date>2007-07-05T10:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: apache + redhat + mod_rewrite</title>
      <link>https://community.hpe.com/t5/operating-system-linux/apache-redhat-mod-rewrite/m-p/4032928#M29146</link>
      <description>Generally speaking, you should put the rewrite directives inside the vhost entry for the site.  If you put it in the main configuration file, the rewrite will affect all domains under control of the server.  Here's a list of the rewrites I'm using on one of my domains.  Use them as examples for fine-tuning the rules I provided above.  The log can be a great help when you're trying to figure out why it isn't working.&lt;BR /&gt;&lt;BR /&gt;        # turn on the mod_rewrite engine and set the log&lt;BR /&gt;        # if you want to debug, the log level should be set higher (I use '9')&lt;BR /&gt;        RewriteEngine On&lt;BR /&gt;        RewriteLogLevel 0&lt;BR /&gt;        RewriteLog /var/log/rewrite.log&lt;BR /&gt;&lt;BR /&gt;        # rewrite entry for TRACE methods&lt;BR /&gt;        # TRACE methods can be leveraged to create a vulnerability and do not&lt;BR /&gt;        # serve any real purpose...disabling them is a good idea&lt;BR /&gt;        RewriteCond %{REQUEST_METHOD} ^TRACE&lt;BR /&gt;        RewriteRule .* - [F]&lt;BR /&gt;&lt;BR /&gt;        # rewrite to mydomain..com, regardless of incoming domain&lt;BR /&gt;        # I host several aliases on the same domain, but want the URL to always&lt;BR /&gt;        # read the 'real' domain name.  This section takes care of that.&lt;BR /&gt;        RewriteCond %{HTTP_HOST}        !^www\.mydomain.\.com [NC]&lt;BR /&gt;        RewriteCond %{HTTP_HOST}        !^webmail\.mydomain\.com [NC]&lt;BR /&gt;        RewriteRule ^/(.*)              &lt;A href="https://www.mydomain..com/$1" target="_blank"&gt;https://www.mydomain..com/$1&lt;/A&gt; [L,R]&lt;BR /&gt;&lt;BR /&gt;        # This entry ensures I never have a blank filename&lt;BR /&gt;        # It's a particular requirement due to how I've built my content management system.&lt;BR /&gt;        RewriteCond %{SCRIPT_FILENAME}  ^/$&lt;BR /&gt;        RewriteCond %{HTTP_HOST}        !^webmail\.mydomain\.com [NC]&lt;BR /&gt;        RewriteRule ^/$                 &lt;A href="https://www.mydomain.com/index.php" target="_blank"&gt;https://www.mydomain.com/index.php&lt;/A&gt; [L,R]&lt;BR /&gt;&lt;BR /&gt;        # rewrite for category pages&lt;BR /&gt;        # This matches any URL like &lt;A href="https://www.mydomain.com/catalog/a_category_name" target="_blank"&gt;https://www.mydomain.com/catalog/a_category_name&lt;/A&gt;&lt;BR /&gt;        # and rewrites it to &lt;A href="https://www.mydomain.com/cat_list.php?cid=" target="_blank"&gt;https://www.mydomain.com/cat_list.php?cid=&lt;/A&gt;&lt;CATEGORY_NUMBER&gt;&lt;BR /&gt;        # /etc/httpd/conf/rewrite.mydomain.txt is a text file used as a conversion map&lt;BR /&gt;        RewriteMap catlist txt:/etc/httpd/conf/rewrite.mydomain.txt&lt;BR /&gt;        RewriteRule ^/catalog/(.+)\.html /${catlist:$1} [NC]&lt;BR /&gt;&lt;BR /&gt;# These entries used for disabling the site&lt;BR /&gt;# First IP entry is office T1, second is home&lt;BR /&gt;# These entries stay commented until I have to take the site down for some kind of extended&lt;BR /&gt;# maintenance.  The two IP conditions allow me to see the normal site from 2 specific locations.&lt;BR /&gt;#       RewriteCond %{SCRIPT_FILENAME}  ^/(.+)\.php [NC]&lt;BR /&gt;#       RewriteCond %{SCRIPT_FILENAME}  !^/maintenance.php [NC]&lt;BR /&gt;#       RewriteCond %{REMOTE_ADDR}      !^11\.22\.33\.44&lt;BR /&gt;#       RewriteCond %{REMOTE_ADDR}      !^55\.66\.77\.88&lt;BR /&gt;#       RewriteRule ^/(.*)         &lt;A href="https://www.mydomain.com/maintenance.php" target="_blank"&gt;https://www.mydomain.com/maintenance.php&lt;/A&gt; [L,R]&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html" target="_blank"&gt;http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/CATEGORY_NUMBER&gt;</description>
      <pubDate>Fri, 06 Jul 2007 02:17:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/apache-redhat-mod-rewrite/m-p/4032928#M29146</guid>
      <dc:creator>sshakthi</dc:creator>
      <dc:date>2007-07-06T02:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: apache + redhat + mod_rewrite</title>
      <link>https://community.hpe.com/t5/operating-system-linux/apache-redhat-mod-rewrite/m-p/4032929#M29147</link>
      <description>also check this link&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://fantomaster.com/faarticles/rewritingurls.txt" target="_blank"&gt;http://fantomaster.com/faarticles/rewritingurls.txt&lt;/A&gt;</description>
      <pubDate>Fri, 06 Jul 2007 03:27:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/apache-redhat-mod-rewrite/m-p/4032929#M29147</guid>
      <dc:creator>sshakthi</dc:creator>
      <dc:date>2007-07-06T03:27:35Z</dc:date>
    </item>
    <item>
      <title>Re: apache + redhat + mod_rewrite</title>
      <link>https://community.hpe.com/t5/operating-system-linux/apache-redhat-mod-rewrite/m-p/4032930#M29148</link>
      <description>Hi there &lt;BR /&gt;&lt;BR /&gt;I have small problem with rewrite again:&lt;BR /&gt;Everythink worksfine but when I'm starting apache I get this error:&lt;BR /&gt;&lt;BR /&gt;cannot use a full URL in a 401 ErrorDocument directive --- ignoring!&lt;BR /&gt;&lt;BR /&gt;Whats up ?&lt;BR /&gt;&lt;BR /&gt;Cheers</description>
      <pubDate>Wed, 29 Aug 2007 11:40:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/apache-redhat-mod-rewrite/m-p/4032930#M29148</guid>
      <dc:creator>Piotr Kirklewski</dc:creator>
      <dc:date>2007-08-29T11:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: apache + redhat + mod_rewrite</title>
      <link>https://community.hpe.com/t5/operating-system-linux/apache-redhat-mod-rewrite/m-p/4032931#M29149</link>
      <description>My file (rewrite.conf) looks like that:&lt;BR /&gt;&lt;BR /&gt;Header append P3P "CP=\"PHY DEM ONL STA NAV COM OUR CURi ADM DEV TAI CAO COR BUS DSP\""&lt;BR /&gt;RewriteEngine On&lt;BR /&gt;rewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.(php|html?)\ HTTP/&lt;BR /&gt;rewriteRule ^index\.(php|html?)$ &lt;A href="http://ttt.com/" target="_blank"&gt;http://ttt.com/&lt;/A&gt; [R=301,L]&lt;BR /&gt;#&lt;BR /&gt;rewriteCond %{HTTP_HOST} ^&lt;A href="http://www.ttt.com" target="_blank"&gt;www.ttt.com&lt;/A&gt;\.com&lt;BR /&gt;rewriteRule (.*) &lt;A href="http://ttt.com/$1" target="_blank"&gt;http://ttt.com/$1&lt;/A&gt; [R=301.L]&lt;BR /&gt;ErrorDocument 400 &lt;A href="http://ttt.com" target="_blank"&gt;http://ttt.com&lt;/A&gt;&lt;BR /&gt;ErrorDocument 401 &lt;A href="http://ttt.com" target="_blank"&gt;http://ttt.com&lt;/A&gt;&lt;BR /&gt;ErrorDocument 403 &lt;A href="http://ttt.com" target="_blank"&gt;http://ttt.com&lt;/A&gt;&lt;BR /&gt;ErrorDocument 404 &lt;A href="http://ttt.com" target="_blank"&gt;http://ttt.com&lt;/A&gt;&lt;BR /&gt;ErrorDocument 500 &lt;A href="http://ttt.com" target="_blank"&gt;http://ttt.com&lt;/A&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 29 Aug 2007 11:43:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/apache-redhat-mod-rewrite/m-p/4032931#M29149</guid>
      <dc:creator>Piotr Kirklewski</dc:creator>
      <dc:date>2007-08-29T11:43:45Z</dc:date>
    </item>
    <item>
      <title>Re: apache + redhat + mod_rewrite</title>
      <link>https://community.hpe.com/t5/operating-system-linux/apache-redhat-mod-rewrite/m-p/4032932#M29150</link>
      <description>According to the message:&lt;BR /&gt;&lt;BR /&gt;cannot use a full URL in a 401 ErrorDocument directive --- ignoring!&lt;BR /&gt;&lt;BR /&gt;The directive:&lt;BR /&gt;&lt;BR /&gt;ErrorDocument 401 &lt;A href="http://mysite.com" target="_blank"&gt;http://mysite.com&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Is not correct, does not like a full URL. You should try something like:&lt;BR /&gt;&lt;BR /&gt;ErrorDocument 401 /subscription_info.html</description>
      <pubDate>Wed, 29 Aug 2007 14:30:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/apache-redhat-mod-rewrite/m-p/4032932#M29150</guid>
      <dc:creator>Ivan Ferreira</dc:creator>
      <dc:date>2007-08-29T14:30:41Z</dc:date>
    </item>
  </channel>
</rss>

