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
- Allow requests to resources outside the wordpress folder
- 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
- How to add custom rewrite rule to .htaccess?
- 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 change default page slug?
- 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?
- How do I add a add_rewrite_rule without it redirecting?
- How do I remove a word from a url in WordPress using .htaccess?
- Hijacking the URL for filtering
- Rewrite rules in .htaccess get overwritten?
- Custom rewrite rules are sending everything to index.php
- WP Login forms action URLs displayed as pretty URLs in browser (ex with Restore Password)
- Sub domain redirection to taxonomy
- custom htaccess rewrite rule for page
- WordPress keeps writing rewrite rules to .htaccess
- How to? Redirect /category/sci-fi/ to /category/scifi/?
- WordPress Rewrite
- Dynamic URL, not a physical page within the database
- unexpected problem in url rewrite
- Auto 301 to full post permalink? (using /posts/%post_id%/%postname%)
- Prevent WordPress from automatically correcting URLs
- Two “.htaccess” Files Located in Different Directories?
- WordPress redirection to get url friendly
- WordPress removes spaces in URL on pagination
- Using WP rather than .htaccess to redirect pages/posts
- htaccess: Remove trailing slash from URL ending with .xml/ only
- External/non-WP rewrite rule without QSA
- Issue with using .htaccess to redirect feedburner feed
- Remove all categories from URL
- Home page with Polylang redirects to other page [closed]
- Remove special characters in a URL
- Add query string to url and display it as normal url part /folder/
- expecting 404 but redirecting to post with url subdirectory in post title
- WordPress .htaccess – route other URLs to another app
- 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
- How to disable the default WordPress redirect to non-www URLs?
- WordPress rewrite rules don’t need ^?
- WordPress SSL (https) is not working with custom permalink
- Changing RSS feed URL structure
- How to redirect http://mydomain/blog/blahblah/ to http://mydomain/blahblah/ in wordpress htaccess?
- 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?
- Preserve Domain Alias
- WordPress redirects non-existing url to existing ones – how to disable
- My WP_options db rewrite_rules Does Not Work
- Disable Pagination on Pages
- How to disable URL rewriting for specific URLs?
- WordPress Redirecting Non Category Pages /page/nnn to their Canonical URLs
- subdirectory install breaking existing links
- a one-off rewrite rule
- .htaccess rewrite
- How can I dynamically generate an image with a static image URL?
- Can I change default registration link (without htaccess)?
- Change htaccess to redirect to index.php in subfolder
- How do I display only the parent page in the url
- Cannot access wp-admin without trailing slash – .htaccess configuration for WordPress behind a nginx proxy
- 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
- Replace specific middle part of url
- Redirect a Blogger Page URL to wordpress