How can I fix multiple 404 errors with Wildcard htaccess redirect
-
Hi all I hope that someone can help....
How can I fix multiple 404 errors with Wildcard htaccess redirect
The url in question is:
How can I fix multiple 404 errors with Wildcard htaccess redirect
http://www.5starweddingdirectory.com/listing/location/uk-england/bedfordshire-weddings/franklin-park
http://www.5starweddingdirectory.com/deal/location/uk-england/chorley-weddings/curtis-bay
etc, going to http://www.5starweddingdirectory.com/business
the above is just a few examples, google webmaster is showing over 8.000 404 page not found errors.
Thanks in advance.
-
Hi Denverish, thanks for your reply, been months since i looked at this problem. It has returned so trying to sort it out. the redirects mentioned did not work. so any suggestions.
The CMS allows for 301 redirects via a form; place old url at the top of the form and the new url at the bottom and save,
But as I am trying to create a wildcard 301 redirect, i am not sure what code to place in these fields..see pic
tai
-
Hi Tai, were you able to implement Matt's suggestions?
-
Hi Tai! Any update on this issue? Please let us know so we can help! Thanks.
Christy
-
Hi Matt, sorry for the delay in getting back.
Just working on your suggestions, I will let you know if it works
T
-
Using the redirectmatch directive to redirect the entire deal directory to deals should definitely work for your situation. You then just repeat for each - so for deals:
RedirectMatch 301 /deal/(.*) /deals/$1
-
Hi Matt,
RewriteEngine On
RewriteRule ^listing/(.*)$ http://www.5starweddingdirectory.com/business/ [R=301,L]Did not work,
other urls flagged up in Google WM are/deal/ new: /deals/
http://www.5starweddingdirectory.com/deal/location/uk-england/buckinghamshire-weddings/newport-beach
http://www.5starweddingdirectory.com/deals/
thanks Matt
-
Hi Tai,
I understand what you are saying in regards to making it easier with all the different URLs, however you will need to specify some start point in terms of being one level down from the domain root else you are effectively placing a wildcard on the whole domain, which wouldn't work when you are still working on this domain. So you need to try to identify the few main category URLs such as /listing and so on in order to create a rule.
Did the redirect I give you work for all URLs apart from the one listed? It should have worked for that.
An alternative you can try is:
RewriteEngine On
RewriteRule ^listing/(.*)$ http://www.5starweddingdirectory.com/business/ [R=301,L] -
Hi Matt, thanks again.
Yes we are trying to redirect old urls to the relevant pages.
As we have so many old urls from old cms system which had different url structures, to do a wildcard to catch all 404s would be great. (wordpress plugin wp redirection achieves this http://wordpress.org/plugins/redirection/)
RedirectMatch 301 ^/listing/.*$ http://www.5starweddingdirectory.com/business
But it did not redirect
http://www.5starweddingdirectory.com/listing/location/uk-england/essex-weddings
Thanks for your time on this.
Regards Tai
-
Hi Tai,
I had a look at your site homepage and from your examples I could see you have relative urls which can cause 404 errors and as you mentioned 8000 I thought this could be part of your problems - no domains in your main navigation links so /business rather than www.yourdomain.com/business in coding - so no base URL can cause this. I took one of your links you mentioned to check if your hrefs were relative.
Putting what I mentioned aside for a second do you just want anything that is /listing and /deal redirecting to /business?
Have you tried this for the listing example and repeat for the others such as /deal/:
RedirectMatch 301 ^/listing/.*$ http://www.5starweddingdirectory.com/business
-
Hi Matt, and thank you for your response.
Not sure if i understand the solution to this problem though. The http://www.5starweddingdirectory.com/listing/......./ are from old legacy urls, and we have many. I am not sure why google webmaster is still picking up these old urls. but having 8k old not found urls is a worry.
Regards Tai
-
You can fix this issue much easier than trying to sort out redirects in htaccess. You are coming across this issue because your site uses relative URLs rather than absolute.
Example:
A relative URL isn't tied to a base URL so:
/business
Absolute would be:
www.5starweddingdirectory.com/business
Using relative means that when you visit a page your link is relative to that location so if I was on
www.5starweddingdirectory.com/business and visited the same llink it would become
www.5starweddingdirectory.com/business/business unless redirected.
Having to fix this issue in htaccess can get messy for this and it would be much simpler to change your nav links in the template of your site. I checked this was the case in your sites source code to be certain and you definitely use relative URLs.
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
-
Redirect chains and rankings
Hi All, I've got interesting question for Moz community today. Has redirect chain got any impact on rankings or not? Thank you in advance.
On-Page Optimization | | Optimal_Strategies0 -
SEO and auto login with redirect
Hi, we have a site where user we know (cookie-based) is automatic redirected to private internal page. Unknown guests are staying on the page google search sent them. The redirect is done with a 302 to the private page. When I examine organic search and landing pages in analytics I see that more than 50% of the landing pages are private pages (inaccessible for the google-bot). This is because analytics does not register the redirecting page, just the target page. Is this harmful to SEO that so many users are redirected to other pages, or is this data not available to google-bot. The google bots is not redirect since they do not have the correct credentials. Do chrome or analytics send such data back to Google search? Is better to manipulate analytics page track call to use the address of the redirecting page? Or maybe skip to redirect, and just render the private content on the orginal page?
On-Page Optimization | | Morten.Berg0 -
Can I use the same text in my meta description as I put in my post excerpt?
Hi, I'm just trying to understand the right way to optimise my blog posts and this is likely a dumb question... but to what extent should the text in my meta description differ from the text in my post excerpts? cheers, Andrew
On-Page Optimization | | seowhiskey0 -
302 redirections warnings
Hi there, the SEOMOZ crawler has detected some warinings related to the 302 temporary redirections. Example: http://www.tarifakitesurfcamp.com/tks-camp/alojamiento/ redirects to www.tarifakeitesurfcamp.com/error-404 I have made some 301 redirections, located at the end of the final (inicially) and later I just moved them to the top of the file. The htaccess file content is: redirect 301 http://www.tarifakitesurfcamp.com/tks-camp/escuela/ http://www.tarifakitesurfcamp.com/gisela-pulido-escuela/
On-Page Optimization | | juanmiguelcr
redirect 301 http://www.tarifakitesurfcamp.com/tks-camp/cursos-kite/ http://www.tarifakitesurfcamp.com/gisela-pulido/
redirect 301 http://www.tarifakitesurfcamp.com/tks-camp/curso-idiomas/ http://www.tarifakitesurfcamp.com/campamento-bilingue-para-ninos/
redirect 301 http://www.tarifakitesurfcamp.com/tks-camp/programa-de-actividades/ http://www.tarifakitesurfcamp.com/kitesurf-para-ninos/
redirect 301 http://www.tarifakitesurfcamp.com/tks-camp/alojamiento/ http://www.tarifakitesurfcamp.com/campamento-de-kitesurf/
redirect 301 http://www.tarifakitesurfcamp.com/tks-camp/la-empresa-2/ http://www.tarifakitesurfcamp.com/kitesurf-para-ninos-tarifa/ BEGIN ASIGNACIÓN DE TIEMPO DE CACHÉ A IMÁGNES, ARCHIVOS JSS, CSS <ifmodule mod_expires.c="">#activa la generacion de cabecera Expires
ExpiresActive On
#establece el tiempo de cache por defecto
ExpiresDefault A604800
<filesmatch ".(jpg|gif|png|css|ico|js)$"="">#suma 1 dia a la hora de acceso del usuario ExpiresDefault "access plus 7 day"</filesmatch></ifmodule> END ASIGNACIÓN DE TIEMPO DE CACHÉ A IMÁGNES, ARCHIVOS JSS, CSS BEGIN W3TC Browser Cache <ifmodule mod_deflate.c=""><ifmodule mod_headers.c="">Header append Vary User-Agent env=!dont-vary</ifmodule>
AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/json
<ifmodule mod_mime.c=""># DEFLATE by extension
AddOutputFilter DEFLATE js css htm html xml</ifmodule></ifmodule> END W3TC Browser Cache BEGIN W3TC Page Cache core <ifmodule mod_rewrite.c="">RewriteEngine On
RewriteBase /
RewriteCond %{HTTP:Accept-Encoding} gzip
RewriteRule .* - [E=W3TC_ENC:_gzip]
RewriteCond %{REQUEST_METHOD} !=POST
RewriteCond %{QUERY_STRING} =""
RewriteCond %{REQUEST_URI} /$
RewriteCond %{HTTP_COOKIE} !(comment_author|wp-postpass|w3tc_logged_out|wordpress_logged_in|wptouch_switch_toggle) [NC]
RewriteCond "%{DOCUMENT_ROOT}/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index.html%{ENV:W3TC_ENC}" -f
RewriteRule .* "/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index.html%{ENV:W3TC_ENC}" [L]</ifmodule> END W3TC Page Cache core BEGIN WordPress <ifmodule mod_rewrite.c="">RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]</ifmodule> END WordPress What's wrong? What could happen is I maintain these 302 redirections? Thanks!0 -
302 Temporary Redirects
Hi, We currently have a number of 302 redirects set up on our e-commerce store that redirect from no forward slash at the end to a forward slash at the end of the url (see below). example: domain.com/treadmills
On-Page Optimization | | DustyBraband
Redirects to
domain.com/treadmills/ Am I correct in saying that this will not pass link juice and the redirects should be changed to 301's (or just removed?). Or are the two urls treated the same (with or without forward slash)? Thanks in advance! Regards,
Dusty0 -
404 like crazy after merging blog
So I merged my wordpress.com blog to my wordpress biz site and I now have a lot of 404's and way to many pages popping up. SEOMOZ crawl shows 290+ pages but my sitemap is only 95 pages... It is also showing on my webmaster tools for having a lot of new errors. Any ideas?
On-Page Optimization | | greenjoe0 -
Can PDFs on your website be picked up in search engines?
Can PDFs on your website be picked up in search engines? There's a ton of info online that says it can and can't be picked up.
On-Page Optimization | | JennH0 -
How to fix duplicate issue among multiple root domains
Hello, I’m doing SEO for one E-commerce website which name is Lily Ann Cabinets & I’ve around 300 different root domains which having same linking structures, same design & even same product database for all 300 websites, but currently I’m focusing only on Lily Ann Cabinets website & trying to get ranking on some targeted keywords, but website is not performing well in Google.com For Example: http://www.lilyanncabinets.com/ (Main Websites)
On-Page Optimization | | CommercePundit
http://www.orlandocabinets.com/
http://www.chicagocabinets.org/
http://www.miamicabinets.org/
http://www.newyorkcabinets.org/
http://www.renocabinets.org/ So please can anyone tell that Will it create duplicate issue in search engines or may be due to this reason website doesn’t have good ranking in search engines, then how can I fix this issue? Do I have to make different structures for Lily Ann Cabinets?0