tablecat Posted September 8, 2009 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.
ltcon Posted September 26, 2009 Posted September 26, 2009 RewriteRule ^old\.html$ http://mywebsite.heliohost.org/img/new.html [R] or add RewriteBase /
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now