tablecat Posted September 8, 2009 Share Posted September 8, 2009 I'm looking at some tutorials for mod_rewrite and I am trying to replicate a simple example: In my .htaccess file I put this: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_ACCEPT} text/html RewriteRule \.html$ - [T=text/html;charset=utf-8] RewriteRule ^old\.html$ new.html [R] </IfModule> When I access http://mywebsite.heliohost.org/img/old.html It redirects me to http://mywebsite.heliohost.org/home/myname/public_html/img/new.html Why is this? How do I fix this? I've been looking all over the internet and there is absolutely nothing. I even tried this on another server and the same thing happens, so I must be doing something wrong. EDIT: Okay, I feel dumb now. I removed [R] and it suddenly started working! I'm not sure why [R] was the culprit, but it works without it. Quote Link to comment Share on other sites More sharing options...
ltcon Posted September 26, 2009 Share Posted September 26, 2009 RewriteRule ^old\.html$ http://mywebsite.heliohost.org/img/new.html [R] or add RewriteBase / Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.