Note that there are some explanatory texts on larger screens.

plurals
  1. PORewrite weird difference between servers
    primarykey
    data
    text
    <p>Today I wrote the following rewrite rules:</p> <pre><code>RewriteCond %{HTTP_HOST} ^visionale\.book [NC] RewriteRule ^\/([^/]+)\/$ $1.php [L] RewriteCond %{HTTP_HOST} ^(www\.)?visionale\.se [NC] RewriteRule ^(.*)/$ $1.php </code></pre> <p>The firs is for my laptop where I run Apache, the second rule for the web hotel.</p> <p>Applying the first rewrite on the web hotel results in a 404 Not Found</p> <p>Applying the second rule on my laptop mysteriously results in "pagename.php.php.php" not found.</p> <p>Now the solution I provided works at both locations but I am baffled about what really is happening. My local machine runs Apache 2.4.6. The web hotel runs Litespeed. So this is an incompatibility of course, but exactly how.</p> <p>My guess is that Litespeed misses the first rule because of missing functionality, but why does Apache not get the easier one, that I've used many times in the past?</p> <p>Edit: Clarifying the questions.</p> <p>This rule:</p> <pre><code>RewriteRule ^\/([^/]+)\/$ $1.php [L] </code></pre> <p>Is not picked on my web hotel running Litespeed. My guess is that this is because Litespeed has a flawed rewrite implementation. I'd like to get that hunch confirmed or another explanation privided.</p> <p>This rule:</p> <pre><code>RewriteRule ^(.*)/$ $1.php </code></pre> <p>Does not work on my dev-machine <strong>any more</strong> but it has worked in the past. It seems simple enough. Anything ending with a trailing slash should instead get a ".php" extension. However, on my dev machine it adds three ".php" instead of one. The rule works as intended in the web hotel and it has worked for me locally in the past. This is puzzling and I would like an explanation.</p>
    singulars
    1. This table or related slice is empty.
    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.
    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