Note that there are some explanatory texts on larger screens.

plurals
  1. PORewriteRule of .htaccess, with slash at the end
    primarykey
    data
    text
    <p>I have two kinds of links on my site: first are finishing with .html, and second that are finishing with / (with slash, in a case that filename is not finishing with .html).</p> <p>Cause of some rewriting rules, in a case that file is not .html, and if is added / at the end, URL is not properly rewritten.</p> <p>Like:</p> <p>It is ok with link: <code>http://mysite.com/cars/fast-cars</code></p> <p>But not ok with link: <code>http://mysite.com/cars/fast-cars/</code></p> <p>So, what I need is when URL is finishing with <code>/</code> and not with (<code>.html/</code>), to be redirected to same page, without <code>/</code>, or in this case:</p> <p><code>http://mysite.com/cars/fast-cars/</code> to be redirected to <code>http://mysite.com/cars/fast-cars</code>.</p> <p>Hope I was clear, and that you can help me with that htaccess rule. Thank you in advance.</p> <p><strong>UPDATED:</strong> i did found part of solution here: <a href="https://stackoverflow.com/questions/540493/htaccess-with-or-without-slash">.htaccess with or without slash</a>.</p> <p>but, also, my rule should not be valid for some subdirectories (like directory admin, orders, etc). can it be defined also with same rule?</p> <p><strong>UPDATE 2:</strong> I have rules like:</p> <pre><code>RewriteRule ^cars/fast-cars$ /seopage.php?marker=fast-cars$1 </code></pre> <p>Also, tryed with rule that works:</p> <pre><code>RewriteRule (.*)/$ $1 [L,R=301] </code></pre> <p>But that rule have to be bypassed for some directories (ie. admin, orders, etc.).</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload