I'm trying to redirect a page and any subpages to the root but I can't find a way of doing it. I'm using the redirection plugin (https://redirection.me/). I would rather doing it via the plugin to keep all redirects in one place rather than .htaccess.
I would like to redirect https://www.example.co.uk/developments/ and any subpages e.g. https://www.example.co.uk/developments/test or https://www.example.co.uk/developments/another-test etc. to the home page.
I tried just now it seemed to break the subpages so I had to revert the redirect.
This is what I was trying to use in the source URL:
/developments/development-name/*
And the target URL:
/
With REGEX and Ignore Slashes enabled.
/developments/development-name/* is not what you want. It looks like you are trying to do globbing with that *. In regex, the equivalent of a glob * is .* where . means "any character" and .* means zero or more of any character.
The rule that would implement a redirect to the home page is:
source: /developments/.*
target: /
However, redirecting to the home page is not usually a good idea. It is usually better to remove the content and show a custom 410 Gone error saying why the content was removed. When you redirect to the home page:
Users don't get a meaningful error message and get frustrated with the bad user experience
Search engines call it a "soft 404" error and treat it just like the content was removed, so you don't get any SEO benefit.
Related
I have a WordPress site and wanted to redirect all languages to the main page without changing the URL.
I was trying with pass-through rewrite rules in .htaccess but nothing seems to work. WordPress redirects to the original URL treating it as a category that doesn't exist.
Expected behavior
URL https://example.com/es/some-page should be treated as https://example.com/some-page,
https://example.com/de/some-page/subpage should be treated as https://example.com/some-page/subpage
but the original URL must remain in the browser bar, with no redirection.
Current behavior
https://example.com/de/some-page/ redirects to https://example.com/some-page/
It doesn't need to be dynamic, I can specify all languages as separate rules.
My SEO tool is telling me that https://example.com has duplicate content with those pages.
URL(s) with Duplicate Page Titles
https://example.com/Employment/default.aspx
https://example.com/employment/Default.aspx
https://example.com/Employment/Default.aspx
i have IIS6 and i used a rewrite lowercase rule to solve this, the problem is solved on the browser and all URLS are lowercase now but i still have duplicate pages and my SEO tool is still showing the duplicates
i want to write a rule on IIS to get rid of those duplicates
PS: https://example.com is the same page as https://example.com/Employment/Default.aspx
Assuming the content on all pages is the same and this is, in fact, the same page (with different URLs), then rel=canonical is your best bet. This will tell Googlebot (and Bing, etc) that Default.aspx is really the same as default.aspx, and to attribute any search relevancy you receive with Default.aspx to default.aspx.
On proper canonical tags here:
https://support.google.com/webmasters/answer/139066?hl=en
Alternatively (and perhaps to be used in conjunction with), there are 301 permanent redirects.
This accomplishes effectively the same as the canonical, but permanently redirects visitors from Default.aspx to default.aspx, Googlebot included. Again, search relevancy will be passed from the former to the latter link.
More on implementing below:
http://www.iis.net/configreference/system.webserver/httpredirect
I have a wordpress website, where I am trying to redirect users to a different page based on a URL parameter. This is what I am trying to solve:-
Current page: - www.mysite.com/hi/
If there is a parameter 'report=show', then I would want the user to be directly redirected to a different page:-
www.mysite.com/hi/?report=show should redirect the user to
www.mysite.com/report If the parameter does not exist, the user should be shown www.mysite.com/hi/
I tried doing a htacess rewrite, but it didn't make any difference.. don't know why!
Not sure why the .htaccess isn't working (as you didn't post it).
Easiest way though is to use the Wordpress Redirection Plugin.
You would add a new redirect rule. Keep the defaults for the other settings, and enter the following two values:
Source URL: /hi/?report=shows
Target Url: /report
In the site I'm building there is a post-type called "Focus". Since they need to url to be like www.mysite.com/focus/page-post-name I have the post type slug as "focus".
Of course the archive page is www.mysite.com/focus this is causing an issue since I need a specific page to be an archive page. Metaboxes are used to build and add settings to pages. I can't just create a page called "Focus" since that is reserved by the post-type.
My idea is to create a page called "Our Focus" resulting a URL of www.mysite.com/our-focus.
I'd like to just remove the "our-" from that url to make it appear that the archive is being used.
I've tried setting has_archive to false but that just reverts to using the archive.php page.
I'm mobile and working without access to a test server, so forgive any errors.
It sounds like you need mod_rewrite, it should be packaged with apache, but may be off. Typically you'll have to check the mods_enabled directory in your apache conf directory, or search your conf file for rewrite.
You'll need two lines in your htaccess at least.
RewriteEngine on
RewriteRule ^/focus/?$ /our-focus/
First line is required to enable rewrite.
The second line is the rule declaration, a regex to match, and a destination. The regex should only match focus, and direct you accordingly. Wordpress may take issue, but I think this will work.
Docs for reference
http://httpd.apache.org/docs/current/mod/mod_rewrite.html
You may need RewriteBase depending on setup. RewriteBase is typically used if there are virtualHosts or a different base url then the server expects.
So recently I updated my site from Joomla to Wordpress. (best decision of my life...seriously)
All of my old Joomla links were formatted with a ? right after my domain name like this: www.example.com/?blah
Now when I switched to Wordpress, I'm using pretty URLs that are formatted like this : www.example.com/blah
Now googles got all the old Joomla urls still indexed so when searched for it still gives you the old URLs. In my head those Joomla URLs should throw a 404 error. But they don't! They just display the homepage.
For Example - if you go to www.example.com/blah it will throw a 404 error because that page doesn't exist, however if you go to www.example.com/?blah it will show that URL in the address bar, but display the homepage despite the fact that that page does not exist either.
So my questions are:
1) will google eventually dump those URLs in favor of my Wordpress ones? How will that hurt my SEO and page rank - does google still see that as a valid page and keep it in its index?
2) How do I force 404 errors for those URLs that don't exist anymore with a question mark.
(1) You'll have to get your sitemap redone and have GoogleBot reindex your site. Google Webmaster Tools should be the place to do that.
(2) You could redirect the invalid links to a 404 page using your .htaccess file