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
-
Can you help by advising how to stop a URL from referring to another URL on my website please?
Stopping a redirect from one URL to another due to a 404 error? Referred URL which is (https://webwritinglab.com/know-exactly-what-your-ideal-clients-want-in-8-easy-steps/%5Bnull%20id=43484%5D) Referring URL (https://webwritinglab.com/know-exactly-what-your-ideal-clients-want-in-8-easy-steps/)
Technical SEO | | Nichole.wynter20200 -
Help. Recently my organic traffic has dropped 40%. Any advice / ideas?
Lately my organic traffic has dropped significantly as well as my adsense revenue. The moz report says, for example, my traffic is down 40%, but I a still #1 for that keyword. Also, in the last week, suddenly my number of indexed pages doubled. We had done some page rewriting and maybe messed that up. We've fixed that though. Webmaster tools is still picking up all of our old pages and the new ones. Background: We recently launched our new responsive website in March. March income was about the same as February. April dropped off suddenly (maybe late march - no sure) When we changed site, we did do 301's for all the old pages to the new ones Any ideas or advice as to why my traffic and revenue has dropped off so sharply? Never submitted questions before - not sure if I am supposed to put urls here so if you just google Home Spelling Words - that's my website. Thanks everyone!!!
Technical SEO | | kimtastic0 -
Can someone PLEASE help me find a solution to use a custom search engine for iPhones?? Thanks in advance!
Hey mozzers, I'm in quite the pickle today and would really appreciate some help! i need a way to have my members set their default custom search engine on their iPhones and androids to our sites search engine. Google chrome does on desktops but not iPhones. Thanks for your time/help, Tyler Abernethy
Technical SEO | | TylerAbernethy0 -
Someone is building anchor text links with child porn keywords..help :-(
Hey Everyone; I recently found that there are tons of links to my url (30+) from several sites with the anchor text "download child porn, kiddie porn, and the likes". Although the sites linking to us where the person built the links do not have this content (thank god) it is just my url + the horrible anchor text someone is putting. [added image] Obviously I would not do that to my own site especially since I was ranked for over 15 keywords in the top 5 spots on Google and Bing. I am guessing its a competitor and I am wondering that is there any way I can remove them? Is this negative seo? Also could this be the reason my site has dropped off google page 1 last month for all my positions? I am consistently trying to rebuild but my positions are flying all over the place. Im going from ranking #12 one week to #198 the next; then to #60 and finally not even on google or bing anymore; then back to #50, etc for the past month and a half... Its very aggravating and it has hurt a few of my websites; im at a total loss on how to recover now if this is the case...It seems they have started to build these links in January from what I can find on the postings.. Thank you SEOMOZ im so happy im a member now. Any suggestions on how i can get these links off or if it is why my site has lost its original rankings.. Should I just can my website and start all over with a different URL? How can I watch out for this in the future? Any help would be so so so greatly appreciated and valued 🙂 xpVjMw8
Technical SEO | | Circa0 -
Help! www and non-www urls are driving me mad!
Sorry folks, I'm a very recently joined member, and after a five year gap in creating websites, I've decided to get back into the saddle and start again. Boy how things have changed! I'm soaking up all sorts of information from everywhere I can to get up to date with these changes, but I've come across this www v non-www problem in a big way. I realise there are already posts in here about this, but each time I read them, my mind seems to slip into some sort of loop that does not get anywhere. Basically, I think Google has indexed most of my pages as non-www, and only a hadful as www's. I have opened two accounts in Google Webmaster Tools for both www and non-www, and declared my preference for both accordingly. That was two days ago. As unprofessional as it may sound, I use Serif Web Plus X6, simply beacause it did the job six years ago, and it's all I know until I find and teach myself something better. My question is this - I can only create one page on X6, and yet there are two versions indexed in Google (although not all of them). I can only amend the one page that exists in X6, so how do I canonicalize two pages when there's the only version I have access to amending? Or am I miissing the point??? I hope that made sense?! I wouldn't mind, but I specified that I didn't want the site to be indexed yet with 'no follow', as it's nowhere near finished, but for some reason (probably due to placing Adsense ads on there) Google went ahead and indexed it anyway! The site is either http://www.cushioncutengagementringsstore.com or http://cushioncutengagementringsstore.com, depending on how you look at it! Any light you can shed on this would be gratefuly received! Thanks. Cem.
Technical SEO | | ConwyWebDesign0 -
Can you help with some concerns over mobile site in SERPS
Hi Guys I wonder if you can put me right on this query please? We have a mobile version of our site, on an m. domain. it is actually http://m.uniquemagazines.co.uk. I have created a mobile sitemap, and added the sitemap reference to the robots.txt file. I have setup the site in web master tools, and submitted the sitemap to web master tools. The sitemap can be found at http://m.uniquemagazines.co.uk/sitemap.xml. This is an index file, which in turn links to 3 sitemaps, one for pages, one for product pages and one for category pages. I have not blocked any crawlers in the robots.txt file. My query is we have some products showing up in the SERPS with both the mobile and normal website. Secondly, in web master tools I am told that our mobile sitemap contains 3675 submitted URLs. However, it states under the WEB banner that 3675 submitted, and 3675 indexed. But under MOBILE it states 3675 submitted, none indexed... I will attempt to attach a screenshot from WMT of this. Do you have any ideas what has gone wrong here? is it wrong, or is this what you would expect to see? Many thanks Paul ScreenHunter_18%20Feb.%2021%2010.55.jpg
Technical SEO | | TheUniqueSEO0 -
Removing URL Parentheses in HTACCESS
Im reworking a website for a client, and their current URLs have parentheses. I'd like to get rid of these, but individual 301 redirects in htaccess is not practical, since the parentheses are located in many URLs. Does anyone know an HTACCESS rule that will simply remove URL parantheses as a 301 redirect?
Technical SEO | | JaredMumford0 -
Help - just disappeared from Google
My google listings have disappeared in the last few days. I used to have positions 1, 2, 3, and sometimes 4 on page 1, but since the last update (19th?) it appears I have been dropped? My domainn is www.eseyo.com and the search terms I used to acheive results for were "seo in brentwood" and "seo brentwood" I even created a screencast of my success some time ago for a blog post: http://www.eseyo.com/seo-in-brentwood/ Is there anything that I can do to get these listings back? I have not done anything too naughty in terms of tactics. Purchased a few fiver gigs to get some fake social likes but that is it the rest was all true links and listings. your help and advice most appreciated. Scott.
Technical SEO | | eseyo0