Note that there are some explanatory texts on larger screens.

plurals
  1. POhtaccess - how to capture the current rewrited url?
    primarykey
    data
    text
    <p>I want to capture the current <strong>rewrited url</strong> via <code>.htaccess</code> in order to create to a custom HTTP Link header.</p> <p>the script url :</p> <pre><code>http://localhost/index.php </code></pre> <p>the rewrited url :</p> <pre><code>http://localhost/news </code></pre> <p>the htaccess:</p> <pre><code>RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(news)$ index.php?&amp;m=$1 [NC,L,QSA] RewriteRule ^(.*) - [E=ORIGPROTO:http] RewriteRule ^(.*) - [E=ORIGURI:%{HTTP_HOST}] RewriteRule ^(.*) - [E=ORIGQRY:%{REQUEST_URI}] </code></pre> <p>the output:</p> <pre><code>ORIGPROTO = http ORIGURI = localhost ORIGQRY = index.php </code></pre> <p>I am expecting ORIGQRY to be equal to 'news'</p> <p>My question is how to capture the current rewrited url via htaccess?</p> <p><strong>EDIT 1</strong></p> <pre><code>RewriteRule ^(.*) - [E=ORIGPROTO:http] RewriteRule ^(.*) - [E=ORIGURI:%{HTTP_HOST}] RewriteCond %{REQUEST_FILENAME} -d RewriteCond %{REQUEST_URI} ^(.*)[^/]$ RewriteRule . %1/ [R=301,L] RewriteCond %{REQUEST_METHOD} !=POST RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} ^(.*?)(/{2,})(.*)$ RewriteRule . %1/%3 [R=301,L] RewriteCond %{REQUEST_METHOD} !=POST RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} ^(.*)_(.*)$ RewriteRule . %1-%2 [R=301,L] RewriteCond %{REQUEST_METHOD} !=POST RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} ^(.*)\º(.*)$ RewriteRule . %1%2 [R=301,L] RewriteCond %{REQUEST_METHOD} !=POST RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} ^(.*)\!(.*)$ RewriteRule . %1 [R=301,L] RewriteCond %{REQUEST_METHOD} !=POST RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} ^(.*)\,(.*)$ RewriteRule . %1%2 [R=301,L] RewriteCond %{REQUEST_METHOD} !=POST RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} ^(.*)\'(.*)$ RewriteRule . %1%2 [R=301,L] RewriteCond %{REQUEST_METHOD} !=POST RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} ^(.*)\"(.*)$ RewriteRule . %1%2 [R=301,L] RewriteCond %{REQUEST_METHOD} !=POST RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} ^(.*)\“(.*)$ RewriteRule . %1%2 [R=301,L] RewriteCond %{REQUEST_METHOD} !=POST RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} ^(.*)\”(.*)$ RewriteRule . %1%2 [R=301,L] RewriteCond %{REQUEST_METHOD} !=POST RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} ^(.*)\((.*)$ RewriteRule . %1%2 [R=301,L] RewriteCond %{REQUEST_METHOD} !=POST RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} ^(.*)\)(.*)$ RewriteRule . %1%2 [R=301,L] RewriteCond %{REQUEST_METHOD} !=POST RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} ^(.*)\[(.*)$ RewriteRule . %1%2 [R=301,L] RewriteCond %{REQUEST_METHOD} !=POST RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} ^(.*)\](.*)$ RewriteRule . %1%2 [R=301,L] RewriteCond %{REQUEST_METHOD} !=POST RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} ^(.*)\{(.*)$ RewriteRule . %1%2 [R=301,L] RewriteCond %{REQUEST_METHOD} !=POST RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} ^(.*)\}(.*)$ RewriteRule . %1%2 [R=301,L] RewriteCond %{REQUEST_METHOD} !=POST RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} ^(.*)\:(.*)$ RewriteRule . %1-%2 [R=301,L] RewriteCond %{REQUEST_METHOD} !=POST RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} ^(.*)\+(.*)$ RewriteRule . %1-%2 [R=301,L] #avoid uppercase &amp; accented RewriteCond %{REQUEST_METHOD} !=POST RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} ^(.*?)(A|Â|â|Æ|æ|À|à|Å|å|Ã|ã|Ä|ä)(.*?)$ RewriteRule . %1a%3 [R=301,L] . . . RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(news)/?$ index.php?&amp;m=$1 [NC,QSA,E=ORIGQRY:$1,L] #404 page RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?pt=404&amp;acc=404_page [L] Header always set Link "&lt;http://cache_api.com/%{ORIGPROTO}e://%{ORIGURI}e%{ORIGQRY}e&gt;;rel=timegate" </code></pre>
    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.
    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