Note that there are some explanatory texts on larger screens.

plurals
  1. POhtaccess problems and general regex
    primarykey
    data
    text
    <p>i'm having problems with my htaccess rewrites.</p> <p>the line is :</p> <pre><code>RewriteRule ^sports/([^/\]+)/?([^/\]+)/?([^/\.]+)/?$ index.php?v=sports&amp;title=$1&amp;go=$2&amp;d=$3 [L] </code></pre> <p>for this url : <code>http://localhost/host/sports/other/</code> -> it will result:</p> <pre><code>***object(url)[3] public 'v' =&gt; string 'sports' (length=6) public 'title' =&gt; string 'other' (length=5)*** ( these are the var_dump of Gets); </code></pre> <p>so far for this url, its all fine BUT for this URL: <a href="http://localhost/host/sports/baseball/aliasss/" rel="nofollow">http://localhost/host/sports/baseball/aliasss/</a> it will results : 404 not found, i have to modify the regex and add a '.' so:</p> <pre><code>RewriteRule ^sports/([^/\]+)/?([^/\.]+)/?([^/\.]+)/?$ index.php?v=sports&amp;title=$1&amp;go=$2&amp;d=$3 [L] </code></pre> <p>it works fine then. but if i keep the dot, and check the old url, with 2 folders only, it will results this : </p> <pre><code>object(url)[3] public 'v' =&gt; string 'sports' (length=6) public 'title' =&gt; string 'basebal' (length=7) public 'go' =&gt; string 'l' (length=1) </code></pre> <p>if you see the link is : <code>/sports/basebal/l</code> instead of <code>/sports/baseball</code>, 1 letter is missing from the query, HELP! thanks :)</p> <hr> <p>it worked fine after i added two lines n two cases :</p> <pre><code>RewriteRule ^sports/([^/\]+)/?([^/\.]+)/?$ index.php?v=sports&amp;title=$1 [L] RewriteRule ^sports/([^/\]+)/?([^/\.]+)/?([^/\.]+)/?$ index.php?v=sports&amp;title=$1&amp;go=$2&amp;d=$3 [L] </code></pre> <p>but i dnt think this is the right way, that means if i want another level i have to add another line ...humph</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.
 

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