Guest User

Untitled

a guest
Feb 17th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. <IfModule mod_rewrite.c>
  2. RewriteEngine On
  3. RewriteBase /cms_project
  4. RewriteCond %{REQUEST_URI} single(.*)
  5. RewriteRule ^(.+)$ single.php?url=$1
  6. </IfModule>
  7.  
  8. //want to query strings single/posts/1/post-title
  9. echo $_GET['url'];
  10.  
  11. OR
  12.  
  13. //function to get url query string convert it to an array
  14. function getUrl() {
  15. if(isset($_GET['url'])) {
  16. $url = rtrim($_GET['url'],'/');
  17. $url = filter_var($url, FILTER_SANITIZE_URL);
  18. $url = explode('/', $url);
  19. return $url;
  20. }
  21. }
  22. print_r($_GET['url']);
Add Comment
Please, Sign In to add comment