1. This website uses cookies to improve service and provide a tailored user experience. By using this site, you agree to this use. See our Cookie Policy.
    Dismiss Notice

.htaccess not redirecting properly

Discussion in 'General Scripting Chat' started by DesignEx, Oct 26, 2011.

  1. DesignEx

    DesignEx Regular Member

    Mar 11, 2011
    Likes Received:
    Own a web development company
    I have a database that I wanted to use to populate a bunch of different pages, but instead of showing url.com/phpscript.php?query=XXXXX, I wanted it to process url.com/category/XXXX.html

    I have it working, but my problem is that Google is still indexing the PHP script with the query (and it's appearing in the toolbar as well).

    My .htaccess looks like this:

    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^category/(.*)\.html$ /category.php?string=$1 [NC,L]

    Any idea on how to make this look like 100% HTML from the outside?
  2. appman360

    appman360 Newbie

    Sep 21, 2011
    Likes Received:
    I think you'd have to change all the links on your site.

    If you've already done that, you probably just need to wait for google to replace the old links.

    The htaccess only rewrites the pages so that category/something.html can be used instead of category.php?string=something.
  3. theMHR

    theMHR Junior Member

    Apr 27, 2011
    Likes Received:
    He is right, you have to change the links on all pages. But I have get the same problem with one of my site, I change all the links as well as change the .htaccess script but Google is still indexing those dynamic URLs so then I contact an apache expert on some other forum, they tell me the arrangement of your .htaccess Rewrites or Recond are wrong, you have to correct them, then I send whole my .htaccess to him, so he sends me the correct arrangement.

    If you can send me then I will send you back in this forum in correct arrangement.