I am having problem in URL rewriting using .htaccess file, problem is as below.
When I put below code in my .htaccess file on server
RewriteRule ^/?xyz http://google.com [R=301]
and I call url MY_WEB_DOMAIN.COM/xyza in browser it redirects me to google.com ( as expected )
And if I call url MY_WEB_DOMAIN.COM/xyz/abc I get 404 error..
isn’t it should redirect to google on both case?
or something else is affecting my code with I use / (slash) in my pattern?
Thanks in advance.
Rewriting was working ok.
I checked headers on server side for rewritten URL and directly called url.
I found only one change.
in direct url It was containing redirect_url and request_uri were same.. for rewriten url both were different.
(I thought oxwall might be using request_uri to process.. where as it was not as I wanted to be..
So I just made them same for rewritten url in php. by placing line
$_SERVER[‘REQUEST_URI’]=$_SERVER[‘REDIRECT_URL’];
And It is done. 🙂