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 3 of 3
  1. #1
    New Coder
    Join Date
    Dec 2011
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    htaccess SEO friendly URL question

    I have a website that i'm working on, the pages are as follow:

    http://www.example.com/index.php?p=1

    what i'm trying to do, i have a table in the database and has names of pages, i want to take out "index.php?p=1" and add the name of the page instead to be as follow:

    http://www.example.com/page.php

    P.S: the "1" digit is just an example, i have several pages not just one.
    I have no experience in htaccess so kindly provide an explanation for the solution. Thanks

  • #2
    New Coder
    Join Date
    Aug 2013
    Posts
    18
    Thanks
    0
    Thanked 4 Times in 4 Posts
    htaccess is one of the most important things in SEO, because with the help of it you can rewrite url which are ugly in SEO prospects, so you must have to rewrite it with the help of .htaccess file, also you should redirect pages having 301, 302, like that errors.
    Please visit below link to solve your question, you can find the all answers there.
    https://www.digitalocean.com/communi...-htaccess-file

  • #3
    New Coder
    Join Date
    Apr 2014
    Location
    Daytona Beach, FL
    Posts
    54
    Thanks
    0
    Thanked 1 Time in 1 Post
    Google does not appreciate urls like that..


    What you should be doing is this: (say its a user profile) http://www.example.com/user.php?ID=1

    We would want this to be rewritten like this:
    http://www.example.com/profile/1
    or
    http://www.example.com/profile/1/

    Code:
    Rewrite user/(0-9)/?$ %{DOCUMENT_ROOT}/user.php?ID=$1


  •  

    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
    •