Forum Moderators: phranque

Message Too Old, No Replies

410 Gone Question

         

jk3210

6:31 pm on Aug 22, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you return a 410 Gone response for...

example.com/blog/

...will that affect/harm sub-directories such as...

example.com/blog/dir1/
example.com/blog/dir2/

Thanks

lucy24

10:15 pm on Aug 22, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If you return a 410 Gone response for...

example.com/blog/


Stop right there. Are you returning a 410 for the specific page

example.com/blog/index.html

or for all pages with url in the form

example\.com/blog/[^./]+\.html

or for the entire contents of the /blog/ directory?

What does your current htaccess say? Is it saying it via mod_alias or mod_rewrite?

jk3210

11:23 pm on Aug 22, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Long story, short...

I have a site that has Wordpress installed in a sub-directory "/news/" and I attempted to...

1.) Delete 500+ pages, while...

2.) Changing the url structure of the remaining pages from "/news/dir/yyy/mm/dd/page/" to "/dir/page.htm."

From the results of my first 9 attempts, I now see that this is not something one should undertake when one has been drinking. (Lesson #1)

As of now, I have everything accomplished except I can't get "/news/" to return a 410.

The htaccess file in /news/ reads...

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /news/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /news/index.php [L]
</IfModule>

# END WordPress

Maybe it's just not possible to do a 410 for /news/ while still having the remaining pages function correctly.

phranque

11:29 pm on Aug 22, 2011 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



i don't see where you are sending a 410 Gone response to the directory url request.

jk3210

12:32 am on Aug 23, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I think I have it now. I initially tried this, first in the root htaccess, then in the /news/ htaccess...

Redirect 410 /news/
Redirect 410 /news

...but that disabled everything /news/ and beyond.

I'm now using a Wordpress Redirection plugin that is returning a 410 for /news/, but allowing all other pages to work fine, which is what I was looking for.

That's the last time I'll ever mix Wordpress with a static site.

Thanks all.

phranque

4:43 am on Aug 23, 2011 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



it's is likely that your problem was caused by mixing mod_alias directives (Redirect) with mod_rewrite directives (RewriteRule).
you can further complicate and confuse things by having rewrite/redirect directives in your root directory .htaccess and a subdirectory .htaccess.