Making PHP to html to be Search Engine friendly

hezuo

New Member
Messages
174
Reaction score
0
Points
0
Hi there. I've heard that static pages are easily indexed by search engines like Google. I've searched over the web and in the forums and most people say that i gotta edit the htacccess and use mode rewrite. To be sincere, I don't know how to do it. Can anyone explain me know how to do it? thanks in advance.
 

DeadBattery

Community Support Team
Community Support
Messages
4,018
Reaction score
120
Points
0
Check to see if you have a .htaccess file anywhere. If you do add the code that follows to each .htaccess file. If you don't have it, open a text editor and type the code in. Save it as htaccess. Upload that text file to the root directory except change the title to .htaccess
CODE FOR .htaccess :
Options +FollowSymLinks
RewriteEngine on

Add those two lines and mod_rewrite is enabled. Please post if something doesn't work. :)
 

TarouSensei

New Member
Messages
32
Reaction score
0
Points
0
On top of the tidbit aopsftw gave, you will need to set a Rewrite for the URLs you want. Depending on the situation, this part of your .htaccess will look something like:
Code:
RewriteCond %{HTTP_REFERER} !^http://(www\.)?yoursite.com/.*$      [NC]
RewriteRule /dir/(.*)\.html /script.php?var=$1
This should send the contents of "/script.php?var=TEXT" to the user when he accesses "/dir/TEXT.html"
To Google, this will appear to be a static HTML page, helping you in PageRank.
For more than one var, just use more "$n"s, where n represents which piece of the regexp in your rewrite rule that should be used.
 
Last edited:
Top