0

I have used mod_rewrite in .htaccess (on Apache web server) so that dynamic pages are treated as static html.

The mod_rewrite itself is working fine, so where I had 4 parameters on the URL (php scripts), its now a single html file, eg. product-1-2.html.

However, whilst most of my website is indexed by Google, none of the mod_rewrite html pages are indexed - therefore defeating the objective of using it in the first place.
Does anyone face similar issues, or have any tips / things to check?

I assumed that because it works, ie entering the html based URL does run the dynamic php page and display the correct content - that there was nothing more to it.

Any help appreciated.

2
Contributors
2
Replies
3
Views
10 Years
Discussion Span
Last Post by jwhite68
0

Make sure that you're not using a robots.txt file that might be disallowing spiders to have access to the files. Also make sure you are linking to the mod_rewritten versions throughout your website. If the dynamic URLs are already indexed in the search engines, it might take some time to tell the SEs you want them to use a different URL to access the same page instead. Try using a 301 Redirect from the dynamic versions to their static counterparts.

0

Heres a part of my .htaccess showing the rewrite rule:

RewriteRule ^property-([0-9]*)-(.*).html /fullpage.php?id=$1&mode=prop&redir=$2 [L]

So, it should be able to take property-1.html and convert that to the php (dynamic) equivalent.

Within my website code, I refer to the links as .html too, as per your suggestion. I can also see that the SEs are not indexing the dynamic versions, nor is there anything in robots.txt to prevent them being indexed.

I do have this within my .htaccess though, and not sure exactly what it does or whether its correct:

DirectoryIndex index.php
Options -Indexes
<Files .htaccess>
order allow,deny
deny from all
</Files>

Any other thoughts?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.