.htaccess not redirecting properly

DesignEx

Regular Member
Joined
Mar 11, 2011
Messages
268
Reaction score
55
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?
 
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.
 
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.

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.
 
Back
Top