Welcome Guest, Not a member yet? Register   Sign In
.html/ Fix
#1

[eluser]RaZoR LeGaCy[/eluser]
Hello,

I need to redirect with a 301 redirect all instances of .html/
example: http://www.hellhorror.com/movies/review/...-VHS.html/

I tried in my routes and a controller called fixes.
Routes
Code:
$route[':any.html/'] = "fixes/wrong_html";

Fixes Controller
Code:
function wrong_html(){
    $uri = $this->uri->uri_string();
    $clean_uri = str_replace('.html/', '.html', $uri);
    redirect(base_url() . $clean_uri, 'location', 301);
}

As you can see I tried but can't seem to get it.

P.S. I cannot alter my config file as that would interfere with all current urls.




Theme © iAndrew 2016 - Forum software by © MyBB