You can “workaround” the issue with a redirect in .htaccess
, although it’s not clear why this double-domain-URL would be accessible in the first place.
So, we can redirect URLs of the form example.com/example.com/?cat=6
to example.com/?cat=6
, which you then say is correctly redirected to example.com/category
by WordPress.
For example, at the top of your .htaccess
file:
RewriteRule ^(?:www\.)?example\.com/(.*) /$1 [R=301,L]
This basically removes example.com
(or www.example.com
) from the start of the URL-path. Any query string that was present on the initial request (eg. cat=6
) is passed through to the target URL by default.
Test first with a 302 (temporary) redirect to avoid potential caching issues.
Related Posts:
- Redirecting all old links from previous EE site to new WP site in one go?
- Server (WordPress) redirects files that are not supposed to (using htaccess)
- Rewrite WordPress Custom URL
- Custom rewrite rule
- Alias ‘wp-content’ directory to something shorter (framework?)
- add_rewrite_rule fro html to another url not working
- Rewrite Preview URL to include index.php
- How to remove wordpress directory slash
- Wildcard forward all posts and pages with few exceptions
- Redirecting /px/?q=x to /px/x/
- URL redirect on updating the post date
- Rewrite vs Redirect from ?p={ID}
- Is WordPress API visible from PHP file called in htaccess
- Redirect htaccess [closed]
- 301 Rewriting htaccess
- 404 redirect based on url
- Fresh install redirects to www, breaking page loads
- Redirect A URL Pattern In WordPress Using .htaccess
- Migration from old CMS to WordPress 301 redirection rules?
- Changes done to .htaccess are not getting reverted back
- htaccess – Redirect to subfolder without changing browser URL
- Generic htaccess redirect www to non-www
- Masking wp-content/themes/name/images to just images directory using htaccess
- Passing parameters to a custom page template using clean urls
- Use subdomain for certain urls
- add_rewrite_rule: $matches var not replaced by captured value
- Custom permalinks with NextGEN Gallery
- Clash of the rewrites
- How to remove “admin.php?page=” from wp-admin using .htaccess?
- SEO Friendly URLs for my plugin categories
- Will references to ugly links automatically redirect to their pretty url permalink?
- Custom rewrite rules are sending everything to index.php
- WordPress keeps writing rewrite rules to .htaccess
- WordPress Rewrite
- Using WP rather than .htaccess to redirect pages/posts
- htaccess: Remove trailing slash from URL ending with .xml/ only
- Issue with using .htaccess to redirect feedburner feed
- Remove all categories from URL
- hard flush_rewrite_rules() not regenerating .htaccess
- Map alt domain to specific section of website w/o MU
- Is there a ‘rake routes’ for wordpress?
- Remove Query String from URL on Redirect – Redirection Plugin
- Rewrite rule to load images from production does nothing
- Cleanup URL for a custom page in wordpress
- WordPress rewrite rules don’t need ^?
- WordPress SSL (https) is not working with custom permalink
- Adding rewrite rules directly to .htaccess file
- Access files at new location using old file paths
- NextGEN Gallery Lightbox – Social Share URL Redirect
- Url Rewriting a dynamic wordpress page
- WordPress .htaccess blocks mine?
- My WP_options db rewrite_rules Does Not Work
- Disable Pagination on Pages
- How to disable URL rewriting for specific URLs?
- a one-off rewrite rule
- How can I dynamically generate an image with a static image URL?
- How do I display only the parent page in the url
- Changed pagination URLS to use p= instead of paged=
- “View post” leads to odd URL
- Redirect HTTP to HTTPS for all sub domains (blog posts)
- React Router with WordPress
- joomla to wordpress migration and 404 errors issues [closed]
- Rewriting “pretty” blog category URL with htaccess / add_rewrite_rule() causes 404 page
- Redirect a Blogger Page URL to wordpress
- Map secondary domain to other’s virtual subfolder
- WordPress keeps writing rewrite rules to .htaccess
- htaccess rewrite, adding segment to url
- How to redirect a link to a new link?
- 301 Redirect all posts urls from .html to / (without .html)
- ow to change cutsom page url of wordpress site using htaccess
- force www rewrite if wordpress put in a folder
- WordPress .htaccess ignore path and subsequent .htaccess files in subfolders
- How to customize sub-URLs in a wordpress website (.htaccess)
- Custom permalink structure with %postname% in front of domain name
- Rewrite rule that wp-login.php?action=register is left alone
- WordPress 3.1.2 Network Enabled non-www to www
- Point 404 pages to homepage
- Redirect empty search to another page
- Remove part from dynamic url and redirect
- WordPress URL redirect and replace ? question mark
- Pretty URL via Rewrite
- Rewrite Url using .htaccess or hook
- Is it possible to rewrite a page URL from ID to name from an API?
- Rewrite URL to get rid of wp-content etc and change URL
- Moved WordPress to Subdirectory, still hijacking requests to files outside of its directory
- How to add gallery slug to attachment url?
- Rewrite URL query string for all pages
- Url wordpress rewrite
- ModRewrite not working properly
- taxonomy term in URL slug won’t forward to the correct term for custom post like it does for default categories/normal posts
- Error 404 wordpress redirecting URL
- .htaccess RewriteRule to include post type and taxonomy
- URLs ending with number higher than 2147483647 redirects to to domain.com/2147483647
- URL rewrite results in a 404, but everything should work!
- Stop wordpress to redirecting home page if no page found
- Additional .htaccess rules based on wp page
- WordPress total posts per page changed and now 404 Http error comes out [closed]
- How to redirect a virtual page (e.g. /blog) to the home page?
- How to change search url produced by ‘s GET method?
- Post pages are redirecting to the 404 page in wordpress