Htaccess file help
-
Hi, thanks for looking
i am trying (and failing) to write a htaccess for the following scenario
<colgroup><col width="679"></colgroup>
http://www.gardening-services-edinburgh.com/index.html http://www.gardening-services-edinburgh.com
http://www.gardening-services-edinburgh.com/
|
so that all of these destinations goto the one resource
any ideas?
thanks
andy
-
When I try the url mobile.gardening-services-edinburgh.com/index.html it seems it's being redirected to http://mobile.gardening-services-edinburgh.com/Mobile/ which is generating a 302 to the lost page.
Could you try to take out the last 2 lines - they don't seem to work (adding the trailing slash) and I fear that they are generating this issue.
Like most people on this forum I am not really an expert in regex - you could always try to put your question on a forum like stackoverflow - which is much more technically oriented.
Dirk
-
Hi tried that
heres the code for the.htaccess file
the problem is when you goto our mobile.gardening-services-edinburgh.com/index.html it comes up with a missing webpage
however, when you goto mobile.gardening-services-edinburgh.com without the /index.html it comes up with the correct webpage
any ideas?
thanks
#######################################################################
Diese .htaccess wurde vom STRATO-Webservermanager erstellt
#######################################################################
<ifmodule mod_expires.c="">ExpiresActive On
ExpiresDefault A86400Expires after 1 day
ExpiresByType image/gif A86400
ExpiresByType image/png A86400
ExpiresByType image/jpg A86400
ExpiresByType image/x-icon A86400
ExpiresByType application/pdf A86400
ExpiresByType application/x-javascript A86400
ExpiresByType text/plain A86400Expires after 1 day
ExpiresByType text/css A86400</ifmodule>
mod_gzip_on Yes
<ifmodule mod_deflate.c=""><filesmatch ".(js|css|html|jpg|png|php)$"="">SetOutputFilter DEFLATE</filesmatch></ifmodule>Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^gardening-services-edinburgh.com [NC]
RewriteRule ^(.*)$ http://www.gardening-services-edinburgh.com/$1 [R=301,L]RewriteRule ^index.html$ / [R=301,L]
RewriteRule ^(.*)/index.html$ /$1/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*[^/])$ /$1/ [L,R=301]ErrorDocument 401 http://www.gardening-services-edinburgh.com/Error-Lost-Page.html
ErrorDocument 403 http://www.gardening-services-edinburgh.com/Error-Lost-Page.html
ErrorDocument 404 http://www.gardening-services-edinburgh.com/Error-Lost-Page.html
ErrorDocument 500 http://www.gardening-services-edinburgh.com/Error-Lost-Page.html
-
Hi,
Normally these rules should do the trick:
RewriteEngine On
removes the index (source:http://dense13.com/blog/2012/10/29/removing-index-html-with-mod_rewrite-in-htaccess/)
RewriteRule ^index.html$ / [R=301,L]
RewriteRule ^(.*)/index.html$ /$1/ [R=301,L]adds a trailing slash (source: http://stackoverflow.com/questions/21417263/htaccess-add-remove-trailing-slash-from-url)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*[^/])$ /$1/ [L,R=301]Dirk
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
-
Please who can help me rank my website www.shopdocuments.com ?
Hi , i bought my website this month , i built it myself now i want it to grow seo on google pages and stuff tried google ads but they always block my account don't know why so somebody help me please any company? individual willing to work it for me ? even if paid company no problem
Technical SEO | | planetdocs1 -
Creating a help hub, not sure the best name to use, " keyword help " or " help hub "?
I've been creating new content for our site, lots of help related content, so I created a help hub section. Now the more I go through it, and look at url structure and breadcrumbs, I can't help but think I should be using a keyword in there, but also don't want to over do it, since the keyword we are shooting for is also a subsection of our site, complete with url keyword and breadcrumb. So I just don't want to have too many over redundant titles like keyword this and keyword that, so I came here to get some advice from the awesome community of folks. Keep help hub so it's: Url: site.com/help-hub/helppage1 Breadcrumb: Home > Help-Hub > Help Page 1 or Url: site.com/keyword/help/helppage1 Breadcrumb: Home > Keyword > Help > Help Page 1
Technical SEO | | Deacyde0 -
What's Worse - 404 errors or a huge .htaccess file
We have changed our site architecture pretty significantly and now have many fewer pages (albeit with more robust content and focused linking). My question is, what should I do about all the 404 errors (keep in mind, I am only finding these in Bing Webmaster tools, not Moz or GWT)? Is it worse to have all those 404 errors (hundreds), or to have a massive htaccess file for pages that are only getting hits by the Bing crawlbot. Any insight would be great. Thanks
Technical SEO | | CleanEdisonInc0 -
Blog is outranking my root domain - Why and Help
I have an odd question concerning SERP rankings on Google along with PageRank and Google Trust. I have a website created in HTML with a WP blog created in a sub-directory. I am finding that the blog is getting relatively good rankings yet it seems the root domain is not getting any of the rank or trust passed onto it as it consistently is outranked by the blog. In fact, for a few of our targeted keywords the root domain does not even show up at all, yet the blog does. Our blog is #2 in Google SERPs, a top Google Place ranking, a Youtube video in the top 10 and a Google Ad place somewhere in the mix of first page ads. The root domain is nowhere to be found. Is there something I need to correct either on the site, in Google Webmaster or in WP Settings that I am not aware that is pushing all the Google Rank and Trust to the blog instead of the other way around? I considered changing the WP Site URL to the root domain thinking it will pass more SEO mojo to the root. But I don't think this is the way to go. I am kind of at a loss, any help is appreciated.
Technical SEO | | SEO-Novice0 -
Pointing a sub-domain to a sub-folder in htaccess
I have a client who currently uses shopify for there blog. I want to set them up with a separate blog away from the shopify system and host it in Australia. I know the best option is using a subfolder but as the shopify system is an unmoveable CMS can I somehow point my subdomain to a subfolder and get the benefits of the domain name? I could do this by using the rewrite rule in the htaccess file. If I was to do this would it end up cloaking the URL's of the articles?
Technical SEO | | acs1110 -
Google is somehow linking my two sites that aren't linked! HELP
Good Morning... In my Google webmaster account it is showing an increase of backlinks between one site i own to the other.... This should not happen, as there are no links from one site to the other. I have thoroughly checked many pages on the new site to see if i can find a backlink, but i can't. Does anyone know why this is showing like this (google now shows 50,000 links from one site to the other).. Can someone please take a look and see if you can find any link from one to the other... original site : http://goo.gl/JgK1e new site : http://goo.gl/Jb4ng Please let me know why you guys think this is happening or if you were actually able to find a link on the new site pointing back to the old site... thanks a lot
Technical SEO | | Prime850 -
Url's don't want to show up in google. Please help?
Hi Mozfans 🙂 I'm doing a sitescan for a new client. http://www.vacatures.tuinbouw.nl/ It's a dutch jobsite. Now the problem is here: The url http://www.vacatures.tuinbouw.nl/vacatures/ is in google.
Technical SEO | | MaartenvandenBos
On the same page there are jobs (scroll down) with a followed link.
To a url like this: http://www.vacatures.tuinbouw.nl/vacatures/722/productie+medewerker+paprika+teelt/ The problem is that the second url don't show up in google. When i try to make a sitemap with Gsitecrawler the second url isn't in de sitemap.. :S What am i doing wrong? Thanks!0 -
.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
Technical SEO | | karthik-1755440