.htacess file format for Apache Server
-
Hi,
My website having canonical issue for home page, I have written the .htaccess file and upload the root directory. But still I didn't see any changes in the home page. I am copying syntax which one I have written in the .htaccess file. Please review the syntax and let me know the changes.
Options +FollowSymlinks RewriteEngine on #RewriteBase /
re-direct index.htm to root / ### RewriteCond %{THE_REQUEST} ^./index.htm\ HTTP/ RewriteRule ^(.)index.htm$ /$1 [R=301,L]
re-direct IP address to www ### re-direct non-www to www ### re-direct any parked domain to www of main domain RewriteCond %{http_host} !^www.metricstream.com$ [nc] RewriteRule ^(.*)$ http://www.metricstream.com/$1 [r=301,nc,L]
Is there any specific htaccess file format for apache server?
Thanks,
Karthik
-
Hi Karthik,
I'd recommend posting a new Q&A question about this, as this is now a few months old and a bit buried. You might hold off until Tuesday US time, since we have a holiday tomorrow and there won't be nearly as many people online.
When you do write your question, it would be helpful to add to your post what types of errors you get when you try to implement this -- just what you have tried, and what the results are.
I also see that your site doesn't redirect non-www to www. If you want to fix that too, now would be a good time to ask about it.
Keri
-
Hi Keri,
Thanks for your message. I didn't find solution for the redirection. It would be great if you help me to fix that issue. How we can do the SEO friendly redirection (301) in tomcat server?
Karthik
-
Hi! I'm following up on older Q&A questions. Did any of the resources from the earlier post help you out, or is there anything we can do to help you get this redirect implemented?
-
Hi, there is something: http://httpd.apache.org/docs/1.3/howto/htaccess.html, A tutorial: http://www.freewebmasterhelp.com/tutorials/htaccess/1
And some examples here:
http://knowledge.freshpromo.ca/seo-tools/301-redirect.php
http://www.seo-consultant-services.co.uk/301-redirects-www-non-www-canonical-problems.html
http://www.dailyblogtips.com/how-to-setup-a-301-redirect/
http://www.tamingthebeast.net/articles3/spiders-301-redirect.htm
First example best describes what you need, cannonical redirect
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Using GeoDNS across 3 server locations
Hi, I have multiple servers across UK and USA. I have a web site that serves both areas and was looking at cloning my sites and using GeoDNS to route visitors to the closest server to improve speed and experience So UK visitors would connect to UK dedicated server, North America - New York server and so on Is this a good way or would this effect SEO negatively. Cheers Keith
Technical SEO | | Keith-0071 -
Where does rel=canonical go? One file that manages sort order, view, filters, etc...
Where do I put the rel=canonical when the search.cfm (using URL re-write) page is the one and only page, just using url parameters to control sort, filter, view, etc. Do I just put the rel=canonical at the top of the search.cfm page? The duplicate content issues I am getting are: https://www.domain.com/tx/austin/ https://www.domain.com/tx/austin/?d=25&h=&s=r&t=&v=l&a= Just want to be clear since Moz Pro is picking up both URL's but it's only really one file, search.cfm Thanks in advance for your help.
Technical SEO | | ErnieB0 -
Search Console rejecting XML sitemap files as HTML files, despite them being XML
Hi Moz folks, We have launched an international site that uses subdirectories for regions and have had trouble getting pages outside of USA and Canada indexed. Google Search Console accounts have finally been verified, so we can submit the correct regional sitemap to the relevant search console account. However, when submitting non-USA and CA sitemap files (e.g. AU, NZ, UK), we are receiving a submission error that states, "Your Sitemap appears to be an HTML page," despite them being .xml files, e.g. http://www.t2tea.com/en/au/sitemap1_en_AU.xml. Queries on this suggest it's a W3 Cache plugin problem, but we aren't using Wordpress; the site is running on Demandware. Can anyone guide us on why Google Search Console is rejecting these sitemap files? Page indexation is a real issue. Many thanks in advance!
Technical SEO | | SearchDeploy0 -
HTACESS Redirect Root Domain To Sub-Directory
Hi Guys, I posted on another post here http://moz.com/community/q/site-migration-between-cms-s about an issue I am hleping out on with a client about migrating between Joomla and Wordpress. He wants to keep some of the old links live on the Joomla installation (I have advised that Google won't be able to crawl these) he wants the new wordpress installation to run on www.site.com/customise (a subdirectory) I have researched this and can't see any issues with indexing or page authority as it's just like having an index.php on the end of every URL. So basically if you go to www.site.com it will be redirected to www.site.com/customise. Will there be any issues, will go frown upon this in anway? Kind Regards Neil
Technical SEO | | nezona0 -
Is having no robots.txt file the same as having one and allowing all agents?
The site I am working on currently has no robots.txt file. However, I have just uploaded a sitemap and would like to point the robots.txt file to it. Once I upload the robots.txt file, if I allow access to all agents, is this the same as when the site had no robots.txt file at all; do I need to specify crawler access on can the robots.txt file just contain the link to the sitemap?
Technical SEO | | pugh0 -
Server crashed - What should I do regarding Google SERP´s?
We have several travel websites in Uruguay since 2003. These sites have a very high PR and Trust. The server where all our sites are hosted has crashed and we have been for 2 days now trying to fix all this mess. We hope this problem will be fixed today. Please I really need to know what should I do regarding Google. I mean one of our sites has been ranking in top 1 positions for more than 150 keywords. Will we loose all that? What can we do about it? It´s the first time this has happened to our sites.
Technical SEO | | ceci27100 -
Does server location matter?
Hi guys, A friend's website is hosted in Germany (showing German IP in Flagfox) but it is a UK-based local business that only serves customers within a small radius covering 3 medium sized UK towns (they sell heavy construction materials for collection only). Should I advise him to change hosting location to the UK? Will this help him rank better for regional keyword searches & Google Places? He has some 'followed' links from UK sites (over 6 months old) that are not being picked up by Majestic, OSE or Webmaster Tools - is this likely to be connected to the server location? Thanks in advance for any help!
Technical SEO | | Tman30 -
How to extract URLs from a site (without bringing the server down!)
Hi everybody. One of my clients is migrating to a new ecommerce platform, and we need to get a list of urls from the existing site to start mapping out the 301 redirects. Usually, I'd use a tool like Xenu or Integrity to crawl and output a list. However, the database and server setup is so bad that it can't handle the requests from these tools and it sends the site down. This, unsurprisingly, is one of the reasons for the migration. Does anybody know of a way to get a full list of urls without having to make a bunch of http requests which will kill the site? Any advice would be much appreciated!
Technical SEO | | neooptic0