Redirection with and without /

Hi Friends,

I want to new set of redirection as

If I type http://w3calculator.com/info1/free-code/apache/steps-to-reset--admin-password-plesk-linux-server/ it redirects me right,

I wann it be redirected excatly without any problem even if I type as below.

http://w3calculator.com/info1/free-code/apache/steps-to-reset--admin-password-plesk-linux-server
http://w3calculator.com/info1/free-code/apache/steps-to-reset--admin-password-plesk-linux-server/jsdgfsjghsjhgfvsbvsbc

Even If I type as above it must take me to excat url, how to do this?

It must not accept any duplicate URL, how to write such redirection?

I am trying to do it with


RewriteCond %{REQUEST_URI} ^(.*)/$
RewriteRule ^/(.*)/$ /abcpage.php?title=$1 [L]

DQ,

Same problem with the :kaioken: EVERYTHING :kaioken: atom and superfluous RewriteCond statement as your other thread. PLEASE have a read of the tutorial linked in my signature so you’ll know what’s wrong with (.*) (and my Standard Rant #1):

[rant #1][indent]The use of “lazy regex,” specifically the :kaioken: EVERYTHING :kaioken: atom, (.*), and its close relatives, is the NUMBER ONE coding error of newbies BECAUSE it is “greedy.” Unless you provide an “exit” from your redirection, you will ALWAYS end up in a loop![/indent][/rant #1]

The key to (.*) is knowing that it will match EVERYTHING (and NOTHING AT ALL) so an “escape route” is always required. Examples of those were given in the other thread but not used in your code here.

Repeating the regex of a RewriteRule in a RewriteCond is simply unnecessary (and ridiculous) duplication of effort. Don’t bother to do that as it’s simply not needed (and it does NOT prevent the looping caused by (.*)).

Regards,

DK