Remove a directory using htaccess
-
Hi,
Can someone tell me if there's a way using htaccess to say that everything in a particular directory, let's call it "A", is gone (http 410 code)? i.e. all the links should be de-indexed?
Right now, I'm using the robots file to deny access. I'm not sure if it's the right thing to do since Google webmaster tools is showing me the link as indexed still and a 403 error code.
Thanks.
-
<colgroup><col width="205"> <col span="14" width="64"></colgroup>
| Hello webtarget, First of all I want to tell you about the .htaccess file, It is the file which control the Apache webserver, is very useful and allows you to do a lot of things. |
| Here the below is the link which solves your whole problem regarding .htaccess file. Please check & review it. | | | | | | |
| http://www.catswhocode.com/blog/10-awesome-htaccess-hacks-for-wordpress | | | | | | | | | | -
That's great thanks.
-
Hi
This should solve your problem
<code>RewriteEngine on
RewriteCond %{REQUEST_URI} ./folder/.
RewriteRule (.*) http://www.yourdomain.com/gone.php [R=410,L]</code>Replace "folder" with the name of your folder and instead of a
<code>http://www.yourdomain.com/gone.php</code>
put link towards the page informing visitors that request resource is gone.
Kind regards
Bojan
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
-
Should I use canonical tag in these cases?
Should I use canonical tag in these cases? On the page itself (with the tag pointing to itself) On pages that doesn't have duplicate versions
Technical SEO | | GoMentor0 -
Canonical issues using Screaming Frog and other tools?
In the Directives tab within Screaming Frog, can anyone tell me what the difference between "canonicalised", "canonical", and "no canonical" means? They're found in the filter box. I see the data but am not sure how to interpret them. Which one of these would I check to find canonical issues within a website? Are there any other easy ways to identify canonical issues?
Technical SEO | | Flock.Media0 -
Should I use the Google disavow tool?
Hi I'm a bit new to SEO and am looking for some guidance. Although there is no indication in Webmaster tools that my site is being penalised for bad links, I have noticed that I have over 200 spam links for "Pay Day Loans" pointing to my site. (This was due to a hack on my site several years ago). So my question is two fold. Firstly, is it normal to have spammy links pointing to your site and secondly, should I bother to do anything about it? I did some research into the Disavow tool in Webmaster tools wonder I should use it to block all these links. Thanks
Technical SEO | | hotchilidamo0 -
Should you use the keyword for your page in an image?
Hi there! I am currently working on building up the SEO ranking on a page using a specific keyword - dresses. Within this page, we have an online image library full of dresses which are then added to multiple pages determined by brand, colour, type etc for people to search. I am adding hundreds of images all of dresses - I wanted to know if I name these images using the keyword: for example 'dresses_1, 'dresses_2' - will that have a knock on effect on page I am trying to build up and optimise for the keyword 'dresses'??? Any help is appreciated.
Technical SEO | | Jaybeamer0 -
Still ok to use
This is the flag to prevent google storing a copy of your webpage. I want to use it for good reasons but in 2013 is it still safe to use. My websites not spammy but it's still very fresh with little to no links. Each item I sell takes a lot of research to both buy and sell with the correct info. Once it's sold one I may just come across another and want to hold my advantage of having already done my research and my sold price to myself. Competitors will easily find my old page from a long tail search. Some off my old sold pages keep getting hits and high bounce rates from people using it as reasearch and price benchmark. I want to stop this. So, No archive first, then 301 to category page once sold. Will the two cause a problem in googles eyes?
Technical SEO | | Peter24680 -
Are There Negatives to Removing the Rich Snippet Date
On some of our website's pages, Google displays the date of the last update in the search results. We want to remove this because it cuts off our meta description and it can make our page look outdated. Are there any negative consequences that you can think of when removing the date rich snippet.
Technical SEO | | ProjectLabs0 -
Does anyone use Ning (Custom social site)?
We just got a custom Ning site developed and the second we moved it to our domain, we lost almost all of our rankings in Google. So, we sign up for a SEOMoz Pro account and within a week we see that we have over 6,000 errors and warnings on our site. Duplicate content, duplicate page titles and pages with too many links. Is anyone using Ning and successfully maintaining 1st page rankings in Google? Seems to me that we need hundreds of fixes and modifications in the code of our site to fix all of these errors and get Google to take our penalizations off.
Technical SEO | | danlok0 -
301 Redirect & re-use
I have an old site which is being moved to a new tld due to re-branding. I understand I would do a series of 301 redirects from the pages of the old site to capture the authority and move to the new site. However, at some point in the future (probably 1-2 years) we may want to re-use the old site again for a different brand (it has a good brand, just not for what we're going after). Question is - can a redirected site be re-used at some point in the future? And if so, which site would new authority (links, etc.) go to?
Technical SEO | | uwaim20120