#1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Posts
    204
    Rep Power
    2

    Simple mod-rewrite (get-url)


    Hi!

    i've been trying to get

    http://notflip.be/meetup/meeting.php?m=1

    to

    http://notflip.be/meetup/1

    but none of the rewrite's seem to work.
    Anyone knows's the solution? thanks!
  2. #2
  3. Did you steal it?
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,958
    Rep Power
    9397
  4. #3
  5. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Posts
    204
    Rep Power
    2
    Originally Posted by requinix
    What have you tried?
    I tried the following, and variations on it. no result

    Code:
    RewriteEngine on
    RewriteBase /
    
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^meeting/([^/]*)$ /meeting.php?m=$1 [L]
  6. #4
  7. Did you steal it?
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,958
    Rep Power
    9397
    I can't help but notice the discrepancy between the "meetup" you said and the "meeting" in your code.
  8. #5
  9. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Posts
    204
    Rep Power
    2
    Originally Posted by requinix
    I can't help but notice the discrepancy between the "meetup" you said and the "meeting" in your code.
    Ok but still. it should say http://notflip.be/meeting/ then no? damn this is hard.. am i on the right track?
  10. #6
  11. Did you steal it?
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,958
    Rep Power
    9397
    Oh, and you say /meetup.php. (1) Drop the slash and (2) you said it should go to meeting/meeting.php.
  12. #7
  13. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Posts
    204
    Rep Power
    2
    Originally Posted by requinix
    Oh, and you say /meetup.php. (1) Drop the slash and (2) you said it should go to meeting/meeting.php.
    Pf i don't get it. so the syntax is . rewriterule (whatitneedstobe) (condition) right?
  14. #8
  15. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Posts
    204
    Rep Power
    2
    I tried this.. it's working for now. although i needed to absolute-path all my images and css.

    but when i click on another link it just add's it to the url as following

    /meetup/meeting/1
    /meetup/meeting/meeting/1
    /meetup/meeting/meeting/1

    and so on.. this is my code.

    Code:
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^meeting/([0-9]+)/?$ meeting.php?m=$1 [NC,L]
    thanks!
  16. #9
  17. Did you steal it?
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,958
    Rep Power
    9397
    Originally Posted by notflip
    so the syntax is . rewriterule (whatitneedstobe) (condition) right?
    Right. But the main problem was how you described one thing and then had your rewriting do another thing.

    Originally Posted by notflip
    but when i click on another link it just add's it to the url as following
    Those links need to be absolute too.
  18. #10
  19. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Posts
    204
    Rep Power
    2
    Originally Posted by requinix
    Right. But the main problem was how you described one thing and then had your rewriting do another thing.


    Those links need to be absolute too.
    Didn't know rewriting was that much misery. you basicly have to rewrite all the links on your site? ..
  20. #11
  21. Did you steal it?
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,958
    Rep Power
    9397
    mod_rewrite doesn't fix the links you send to browsers. It allows you to use something more creative but you still need to tell the browsers about the new URLs yourself.

IMN logo majestic logo threadwatch logo seochat tools logo