The only way I managed to get this to work was with the following in the .htaccess
of the /site/ directory:
RewriteBase \
RedirectMatch 301 ^/site/$ /$1
RedirectMatch 301 ^/site/(?!wp-admin/|wp-content/|wp-includes/)(.*)$ /$1
Whilst I am aware that RewriteRule ^site/ /$1 [R=301,NC,L]
should have worked, and that RewriteRule ^site/(.*)$ /$1 [R=301,NC,L]
should have also worked (according to various articles I read), I had no luck with these (and no server error).
My host is Hostgator.com – in case this result is relevant to their particular configuration (which I doubt).
Related Posts:
- htaccess rewrite conflict with wordpress rules and ssl
- Rewrite /?rest_route=/ link to /wp-json/ without changing default permalink structure in apache
- WordPress site displaying 404 for any page apart from index
- .htaccess Rewrite URL WordPress
- different child theme for subdomain
- Struggling with add_rewrite_rule
- .htaccess rewrite rule puzzle
- need a help for modify .htaccess rule [closed]
- How can i redirect one url to another url using .htaccess or add_rewrite_rule
- TimThumb & htaccess : clean url
- What to write in the htaccess in order to detect browser language and point accordingly?
- want to rewrite an URL in wordpress
- How to turn this .htaccess rule into a dynamic rule with add_rewrite_rule, et al?
- htaccess problem not being able to overwrite previous rules
- add_rewrite_rule to remove /category/ from permalink
- Relative links stop working after moving wordpress site from hosting to localhost
- htaccess redirect throws an error: PHP Catchable fatal error: Object of class WP_Error could not be converted to string
- Rewrite Rules not redirecting rewrite
- Rewrite URL in address bar for a specific page [closed]
- How do I reset a rewrite?
- Rewriting subfolders to specific parent folder in WordPress
- Redirect default pagination page to template page’s pagination
- Remove subdirectory from links
- Rewrite rules and maintain URL
- WordPress URL not working?
- rewrite rule on plugin activation
- .htaccess rewrite rule stopped working for wordpress site after moving server
- Improve wordpress security by hiding non public resources
- SEO Friendly URLs for my plugin categories
- Remove year and month in URL using .htaccess
- How to add .htaccess code through a function?
- WordPress keeps writing rewrite rules to .htaccess
- WordPress Rewrite
- Unable to access WP admin
- Move wordpress to folder without changing urls
- Rewrite rule never matching
- Change wp-content without changing the name of the folder
- Using WordPress only for the backend, and using AngularJS as a frontend
- Two domains on one WordPress Installation
- Protect Upload Folder Files With Ampersand Problem
- RedirectMatch and Redirect interfering with each other
- Which WordPress scripts need to be executable for a fresh installation?
- .htaccess and WordPress Admin Bar
- Blocking access to wp-login via htaccess not working
- How to Redirect huge numbers of URLs to another URLs?
- Giving WordPress its own subdirectory – nginx
- Cannot mask WordPress page URL using .htaccess
- How can I make an htaccess file on a Mac? [closed]
- Rewrite rule to load images from production does nothing
- XMLRPC filtering through htaccess not working
- Corrupt .htaccess file
- Cache policy not updated according to PageSpeed
- .htaccess ‘down for maitenance’ and WordPress
- What’s the opposite of required valid user in .htaccess authentication
- Which is better: 301 Redirect in my .htaccess file or a plugin like Redirection?
- Fixing custom 404 pages broken by WordPress in a subdirectory
- I can’t access the admin panel links as I click it shows 403 error
- How to hide login form if basic authentication fails?
- .htaccess rewriting old RSS feed URL to WordPress feed URL
- .htaccess rules for blocking bots with an extra condition
- WordPress – Promoting A Dev Build In A Subdirectory To Production / Root Directory
- .htaccess RewriteRule always overwritten – how to prevent?
- How to create a redirect in the .htaccess file, with 2 exceptions
- Redirect old domain with query paramaters
- What might be removing my redirects from my htaccess?
- Multisite theme path rewrite using .htaccess
- WordPress .htaccess to consider blog as directory
- Disable directory browsing of uploads folder
- Password protect directory but not files
- WordPress JSON API restrict to specific domain
- fix 302 redirection error on https
- main-domain of wordpress keep redirecting to subdomain
- How to deny access to a particular wordpress site url
- Home links redirects to old site
- What causes 404 errors that forces you to rebuild a .htaccess file?
- Configure .htaccess to have a WordPress single site installation with all subdomains pointing to the same pages?
- Azure WordPress deny access to xmlrpc
- Xampp is not loading media
- domain redirection is not working from old to new
- Deny,Allow on .htaccess isn’t working
- execute cron jobs when .htaccess login protected?
- Using htaccess to prevent spam through wp-comments-post.php
- Install second wordpress in root subfolder, Error 404
- Pretty URL via Rewrite
- change URIs of migrated site
- modifying htaccess for localhost with a custom port
- .htaccess redirects for posts in new directory and new domain
- Fixing Access-Control-Allow-Origin (CORS origin) for multiple subdomains
- domain.in/wp-admin give the result to 403 Access to this resource on the server is denied!
- htaccess and redirect to new url using regex
- Restrict Content for only Contributors via .htaccess
- Redirect from domain.com to subdomain.domain.com
- What is the proper way to use add_rewrite_rule to remove the (question mark)?
- MAMP.app & .htaccess – Can’t override after config
- register_post_type and register taxonomy and htaccess
- Cannot find webarh/malware redirect infection that only shows on Chrome
- Why ‘Authorization Required’ is coming on wordpress login
- Restricting direct downloads of wp content files, but allow them on the website.
- Forward blog requests to another URL
- WP-Include rewrite directory