Welcome to WebmasterWorld Guest from 184.108.40.206
Anyway, I had a website with urls like www.domain.org/example/
Recently I changed the site completely, and now I have some ulrs that read www.domain.org/example.html.
The problem is, the old urls (via Google) simply show the page but without styling. So I want to rewrite or redirect the example/ urls to example.html. How do i do this?
but this doesn't work?
However, you don't seem at all clear as to whether you need a rewrite or a redirect - and they are completely different things.
You need to make sure that the content is directly available at only one URL and that all other variations issue a redirect.
In some cases you may also need a rewrite to connect the URL request to the internal filename for that content, when the tail of the URL differs from the actual filename.
If styling is not being seen, then it is likely that you need to begin the links to the stylesheet with a / and state the full folder-path to the stylesheet as it is the browser that resolves the stylesheet location based on the URL for the current HTML page.
RedirectMatch 301 ^/([^/]+)/$ http://www.example.com/$1.html
What went wrong with your redirect directive? the first argument must be an URl-path, i.e.
The problem was that the site used to be in Wordpress. I decided I didn't need a CMS and redid the site "static". I only noticed the problem after I was done.
Anyway, it is working now. Thanks again.
@g1smd: Yes, if I was unable to find a htaccess solution my next option was to rewrite the css-urls, but I was hoping I wouldn't have to. And I don't :-)