SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2011
    Posts
    82
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    problem with htaccess url rewrite

    I have this in my htaccess:

    Code:
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-l
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^([^/]+)/([^/]+)/?$ index.php?name=$1&dircontent=album&album=$2 [L]
    My problem is that if the album name is something with slashes (for example: blabal/fdfdg) it makes an error in my website and don't show the page.
    How I can fix it?
    Owner of uReviews & MovieDB - Movie Database

  2. #2
    SitePoint Wizard bronze trophy Jeff Mott's Avatar
    Join Date
    Jul 2009
    Posts
    1,272
    Mentioned
    18 Post(s)
    Tagged
    0 Thread(s)
    It's typical to create a "slug" for names that appear in the URL. Non-URL-safe characters are stripped out and replaced with a URL-safe separator (most commonly the hyphen). So, for example, "problem with htaccess url rewrite" converted to a slug would be "problem-with-htaccess-url-rewrite". And "blabal/fdfdg" would be "blabal-fdfdg".
    "First make it work. Then make it better."

  3. #3
    SitePoint Enthusiast
    Join Date
    Jun 2011
    Posts
    82
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Jeff Mott View Post
    It's typical to create a "slug" for names that appear in the URL. Non-URL-safe characters are stripped out and replaced with a URL-safe separator (most commonly the hyphen). So, for example, "problem with htaccess url rewrite" converted to a slug would be "problem-with-htaccess-url-rewrite". And "blabal/fdfdg" would be "blabal-fdfdg".
    Oh great idea
    thanks
    Owner of uReviews & MovieDB - Movie Database


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
  •