Last active
May 31, 2019 01:55
-
-
Save BAHC/212a0422c442e7db53fade9c2eec5fb2 to your computer and use it in GitHub Desktop.
Redirect using mod_rewrite
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
RewriteRule ^([A-Za-z]+)/([A-Za-z\+]+)/([0-9]+)/?$ tour/?id=$3&city=$2&country=$1 [NC] | |
RewriteRule ^([A-Za-z]+)/([A-Za-z\+]+)/?$ city/?city=$2&country=$1 [NC] | |
RewriteRule ^([A-Za-z^index]+)/?$ country/?country=$1 [NC] | |
RewriteRule . index.php [L] | |
</IfModule> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>Index Route</h1> | |
<ul> | |
<li>Country/Town/123</li> | |
<li>Russia/Moscow</li> | |
<li>Russia</li> | |
</ul> | |
<p>$_GET: | |
<?php | |
var_dump($_GET); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment