Results 1 to 11 of 11

Thread: Mod Rewrite Assistance

  1. #1
    Gimme Fries with that!
    Join Date
    Aug 2004
    Posts
    1,469

    Mod Rewrite Assistance

    Ola,

    I have just learned how to do this whole mod rewrite deal just got started yesterday with some pretty good success, here is my Q for you smart folks.

    I would like to turn this

    http://www.moviesonline.ca/movie_det...f%20the%20Dead

    into this

    http://www.moviesonline.ca/DawnoftheDead/

    No spaces, no punctuation.... doable?

  2. #2
    Web Monkey MarkB's Avatar
    Join Date
    Nov 2003
    Location
    London, UK
    Posts
    1,783
    You could do Dawn-of-the-Dead with mod_rewrite and str_replace...
    Stepping On Wires - the new blog

  3. #3
    Gimme Fries with that!
    Join Date
    Aug 2004
    Posts
    1,469
    have an htaccess example?

  4. #4
    Future AstonMartin driver r2d2's Avatar
    Join Date
    Dec 2003
    Location
    UK
    Posts
    1,608
    In terms of SEO, MarkB's suggestion would be better, because Google will see them as separate words rather than a bit of gibberish (in Google's 'eyes').

    'Fraid I dont know how to do it with mod-rewrite though, I would use PHP.

  5. #5
    Registered intelliot's Avatar
    Join Date
    Jul 2004
    Posts
    309
    I can do it. It'll take a little time and a combination of mod_rewrite and PHP. Let me know if you're interested (still looking for the solution) otherwise I won't waste my time

    BTW I will be doing as MarkB suggested (hyphens to replace spaces)

    P.S. Google recently stated in their blog that hyphens are better than underscores.
    Last edited by intelliot; 08-12-2004 at 06:12 PM.
    Elliot Lee
    Google Forums - Community for Google Fans!

  6. #6
    Gimme Fries with that!
    Join Date
    Aug 2004
    Posts
    1,469
    indeed hyphens are better then "_".

    Not being familiar with making urls "spiffy" I want to use a method that will make it so google SEES the url correctly.

    Ie, if I make it www.moviesonline.ca/zombiemovies.html I want google to see that and not gibberish, or just get confused.

    Anybody willing to show me the best way i am gratefull for the time.

  7. #7
    Registered intelliot's Avatar
    Join Date
    Jul 2004
    Posts
    309
    The best (and easier) way is to use mod_rewrite and replace spaces with hyphens. so that might be zombie-movies.html
    Elliot Lee
    Google Forums - Community for Google Fans!

  8. #8
    Gimme Fries with that!
    Join Date
    Aug 2004
    Posts
    1,469
    can you show me an example intelliot? very green to mod re-write.

  9. #9
    Registered intelliot's Avatar
    Join Date
    Jul 2004
    Posts
    309
    I'll spend some time to write you a few rewrite rules and report back.
    Elliot Lee
    Google Forums - Community for Google Fans!

  10. #10
    Registered intelliot's Avatar
    Join Date
    Jul 2004
    Posts
    309
    Example .htaccess file (untested)
    Code:
    RewriteEngine On
    RewriteRule ^movie-([a-zA-Z0-9-]*)\?$ movie_details.php?movie=$1
    This will make:
    moviesonline.ca/movie-Dawn-of-the-Dead
    the equivalent of:
    moviesonline.ca/movie_details.php?movie=Dawn-of-the-Dead

    In movie_details.php you will want to str_replace the hyphens with spaces. Make sure it's backwards-compatible for people using the old URLs.
    Elliot Lee
    Google Forums - Community for Google Fans!

  11. #11
    Gimme Fries with that!
    Join Date
    Aug 2004
    Posts
    1,469
    Thanks Elliot. Going to test it out right now. VERY much appreciated....

Similar Threads

  1. Rewrite conditions being ignored
    By mobilebadboy in forum Website Programming & Databases
    Replies: 3
    Last Post: 06-28-2004, 12:55 PM

Bookmarks

Posting Permissions

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