.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 enter image description here i'm on service page atmt if wanted go page enter image description here

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:

  1. change links start "/"
  2. add relative uri base header of page (inside <head> </head> tags:

    <base href="/" /> 

Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -