Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • URL rewriting with PHP using .htaccess

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 499
    Comment on it

    Hello Readers!

    If you have this URL like : url.com/picture.php?id=51

    and you want to make like this : picture.php/Some-text-goes-here/51 .

    In this case it can be done by using htaccess.

    Add a file called .htaccess in your root folder, and add something like this:

    RewriteEngine on
    RewriteRule ^/?Some-text-goes-here/([0-9]+)$ /picture.php?id=$1
    

    This will tell Apache to enable mod_rewrite for this folder, and if it gets asked a URL matching the regular expression it rewrites it internally to what you want, without the end user seeing it.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: