apache - Two regex rewrite rules to redirect 404 urls -
apache - Two regex rewrite rules to redirect 404 urls -
i having next 2 urls give me nasty 404 errors prepare adding rewrite rules apache , must recongnize don't understand regular expressions plenty able write right rules.
first urlhttp://www.example.com/fincas-rusticas/finca-rustica_en_alacant-alicante/lalacanti/alicante/function.strtotime
must redirect same url without /function.strtotime @ end.
second url, nasty one.http://www.example.com/casas/casas_en_malaga/malaga/malaga/ strict standards: variables should passed reference in /var/www/vhosts/eldeposit.com/httpdocs/protected/helpers/search.php on line 1398/casas/casas_en_malaga/malaga/malaga/venta-vivienda-29-473-24693-0-0
this 1 must remove part strict standards error. don't know if can done regular expressions or improve programme in php
1) utilize rule -- remove function.strtotime
end of url (by using 301 permanent redirect) regardless of how deep part in url (i.e. work example.com/something/function.strtotime
example.com/one/two/three/function.strtotime
).
rewriteengine on rewritebase / rewriterule ^(.*)function\.strtotime $1 [l,r=301]
2) cannot fixed using .htaccess. error in php code (sounds you've passed value straight instead of assigning variable first , passing variable) , has fixed in php code.
regex apache mod-rewrite redirect http-status-code-404
Comments
Post a Comment