Jump to content

Recommended Posts

Posted

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.

  • 3 weeks later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...