.htaccess - Why does my Url doesnt drop the current page instead it adds it with the new Link -
hi have written htaccess rule based on sources problem wanted have clean url have done problem doesn't work see image below i'm on service page atmt if wanted go page
the url doesnt drop 1st link instead goes next page adding new link causing not found error..
i've been having hard time finding solution 1 can please tell me did go wrong rule on htaccess doing this?
here .htaccess
rewriteengine on rewritebase / rewritecond %{http:x-forwarded-proto} !https rewritecond %{https} off rewriterule .* https://%{http_host}%{request_uri} [l,r=301] rewritecond %{http_host} !^www\. rewriterule ^ https://www.%{http_host}%{request_uri} [l,r=301,ne] rewritecond %{the_request} \s/*(.*?)/index\.php [nc] rewriterule ^ %1/ [r=302,l] rewritecond %{the_request} \s/+(.+?)\.php[\s?] [nc] rewriterule ^ /%1/ [r=302,l] rewritecond %{request_filename} !-f rewriterule ^[^.]*?[^/.]$ %{request_uri}/ [l,r=302] rewritecond %{request_filename}.php -f rewriterule ^([^.]+?)/?$ $1.php [l]
your rules fine, looks relative url issue. links like:
<a href="client">client</a>
this means it'll append client
@ end of whatever uri path exists (in example, /services/
).
so either:
- change links start "/"
add relative uri base header of page (inside
<head> </head>
tags:<base href="/" />
Comments
Post a Comment