Ad

Redirect To Anchor Point With Php

- 1 answer

So I have a question about a redirect to an anchor point. In my case I have a anchor with the id= product I have for the redirect this code:

<?php Header(
    "Location: http://localhost/#product",
    true,
    301
);
?>

The problem is that I will redirect to http://localhost/#product/ and this is not my anchor point. I could rename it to product/ but I don't like this solution. It would be nice if anyone have a better solution.

Or maybe I can redirect it with the htaccess. If anyone have an example for this. The site which I want to redirect is http://localhost/home/product/

Ad

Answer

My Problem was that there was a setting in wordpress for permealinks with the slash at the end.

Ad
source: stackoverflow.com
Ad