问题
I am using the Concrete 5 CMS to build a website and i'd like to push it live.
I have the code in a directory called /concrete5.5.2.1
and rather than updating the references in the database and moving the code on the filesystem, i'm considering using an .htaccess rule to effectively ignore that directory.
However, I'm keen to know if doing something like this below would mean that Google would index the /concrete5.5.2.1? Or would this be ignored?
RewriteEngine On
RewriteRule ^concrete5.5.2.1/(.+)$ http://www.ayrshireminis.com/$1 [R=301,L]
回答1:
Google will be just like every other user and only see the URLs you provide. So they will not be aware that directory exists.
回答2:
You don't need to use a .htaccess file to have the site show in a different location, simply move the contents of that directory to the root, clear the cache, and re-run the search index job.
You don't have to make any database changes as urls in content are parsed then cached.
Mike
来源:https://stackoverflow.com/questions/11375384/the-google-seo-considerations-over-using-htaccess-rule-to-ignore-top-level-dire