Note that there are some explanatory texts on larger screens.

plurals
  1. PO.htacces Nice urls for subfolder
    primarykey
    data
    text
    <p>I have 1 subfolder located at my root folder: /root/task6/index.php</p> <p>And I need to change urls <code>www.andriussulcas.prinusprojects.lt/task6/index.php?p=naujienos&amp;title=title</code> to <code>www.andriussulcas.prinusprojects.lt/task6/naujienos/title</code></p> <p>I've been trying to do this for some time now and all my efforts weren't successful. While searching for answer, I started thinking that maybe my mod_rewrite wasn't activated. But later on I found how to redirect my web site root to subdirectory, where all my files are. So mod_rewrite works. </p> <p>I found some similar answers here, on stackoverflow, like <a href="https://stackoverflow.com/questions/1018383/how-to-rewrite-rule-for-a-sub-sub-directory-htaccess-php">how to &quot;rewrite rule&quot; for a sub-sub-directory? .htaccess/php</a> but for some reason it doens't work for me.</p> <p>Here's my .htaccess file:</p> <pre><code>Options +FollowSymLinks RewriteEngine On RewriteCond %{HTTP_HOST} ^(www.)?andriussulcas.akademija.prinusprojects.lt$ RewriteCond %{REQUEST_URI} !^/task6/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /task6/$1 RewriteCond %{HTTP_HOST} ^(www.)?andriussulcas.akademija.prinusprojects.lt$ RewriteRule ^(/)?$ task6/index.php?p=naujienos [L] RewriteRule ^naujienos/([A-Za-z0-9-]+)?$ index.php?p=naujienos&amp;title=$1 [L] </code></pre> <p>.htaccess file is located at my root directory, and there are no other .htaccess files at subdirectories.</p> <p>All help is much appreciated.</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