Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jan 2016
    Posts
    224
    Thanks
    50
    Thanked 3 Times in 3 Posts

    Seo urls problem

    Hello,

    I have this htaccess code

    Code:
    RewriteEngine on
    RewriteRule ^playvideo-(.*)$ ./playvideo.php?url=$1
    All I want is get the that is after the "-" of "playvideo", send it to a GET request as parameter "url".

    At the moment my urls are showing as:
    http://mysite.com/playvideo-big-massive-here-is-the-url

    But on the landing page which is:
    http://mysite.com/playvideo.php

    I am not getting an GET results:
    PHP Code:
    $url $_GET['url'];
    echo 
    $url

    Any idea what am I doing wrong please?


    Thank you.

  2. #2
    Regular Coder
    Join Date
    Jan 2016
    Posts
    224
    Thanks
    50
    Thanked 3 Times in 3 Posts
    it looks like the problem is not from the htaccess but instead the $_GET request seems to not fetch the "-" sign when in the url.

  3. #3
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    9,249
    Thanks
    4
    Thanked 932 Times in 919 Posts
    See if escaping the - as \- makes a difference
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  4. #4
    Regular Coder
    Join Date
    Jan 2016
    Posts
    224
    Thanks
    50
    Thanked 3 Times in 3 Posts
    Hi Felgall,

    After spending quiet a bit of time on this, here is what I have found.

    When I was trying to use $_GET['url'] , I was getting nothing, I changed it to $_GET['url_name'] and the string showed up. I tried to find out if this was a reserved word but could not find any doc on this.


 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •