I think htaccess would be fastest way. Overhead of checking 50 simple regexp is very small – page generation is several orders of magnitude slower so you shouldn’t care about it.
This wont hit performance, you can set rewrite only for domain mysite.com and it won’t check rules for tech.mysite.com reducing overhead, which isn’t noticeable anyway.
The disadvantage of modifying wordpress code is that you modification may break with wordpress update and you should remember about it every time you’re updating it.
If you want to make your site faster then try nginx webserver. It can work with php-fpm without apache, or just serve static files much more effectively than apache and proxy requests to php to apache. There is also similar webserver lighthttp.
Related Posts:
- Unable to load static front page on home url
- WordPress Move to SSL How to Update Media Assets to HTTPS?
- How to update media links in WordPress after migration?
- Old URL Redirect website after migration
- The requested URL was not found only on localhost
- Renamed my website (URL) – how do I rename all within-page links to the old URL?
- Website Address Keep redirect to website after migration attempt
- Porting site URLs to new host but with same domain name [closed]
- Broken Images and Style
- How to get the correct URL on my wordpress site?
- After site transfer I’m still getting redirected to the old site (WordPress)
- How do you retrieve a post by slug name through REST API?
- Why “?v=hash” is added to my URLs? [closed]
- Detecting a WordPress URL without doing a full HTTP GET?
- How does WordPress generate URL slugs?
- How does routing on wordpress work?
- Redirecting to old domain after migration
- Unwanted media library URLs in posts?
- How to remove file versions from the file source links in wp_head?
- Add menu and submenu in admin with a URL instead of slug?
- Update media file url in wordpress media library
- Change logo url link
- As soon as I add a custom query_var using the filter, my pages point to an archive page – why?
- Best way of removing emoji support from url / slug only
- Password protected page Hash url
- Which of WordPress’s .php files need to be directly accessible via HTTP?
- Remove site root trailing slash
- How to create a page for authors? like www.myblog.com/author/
- Custom Post type permalink structure with custom_post_id
- Setting a url for a page
- pass user id in slug and get user information
- Best way to give site sub-page it’s own domain?
- Dynamically change page title from URL param
- What is the correct way to convert the absolute path of the executing script to a URL, in WordPress?
- Getting 404 Hits on URI -/-/-/-/-/-/-/-/-/- . How to deal
- How to change logo url [closed]
- Is it possible to configure WordPress’s Core Files to accept duplicate Child Categories?
- Make homepage a non-WordPress page
- Avoid the removal of “https:” from URLs
- Content duplication issue with dynamic URLs
- Is get_permalink also the canonical URL?
- Remove trailing slash from previous_posts_link()
- Moved WP into new folder. How to fix image links in posts?
- How do you make homepage redirect to it’s slashed version?
- Using esc_url_raw with protocols properly
- Site transferred to new server produces 404s
- How to parse a custom url (within WP site) and obtain params passed to that URL
- Change URLs depending on alias
- wordpress copyright dynamic
- How do I avoid messing up URLs when switching from example.com/subdir to example.com?
- Multiple duplicate URL’s
- Made WordPress URL and site address URL the same
- How can i get rid of wp in front of URL
- Dynamic URL and pass the data to an iframe
- DNS – Change WordPress Site Name?
- Alternatives to site_url() and get_template_directory_uri()
- Blog post – single.php url
- WordPress File URL Path Incorrect
- Adding more onto an esc_url [closed]
- Unicode characters are saved in a funny way in the DB
- Replace category name with article id in wordpress urls
- How can I insert a dynamic URL in my email template?
- Redirect Old wordpress url to new wordpress url
- Block registration by URL referrer?
- WordPress Primary Category Changes After Import, Permalink Issue
- Make unique url to unlock a post
- How to set wordpress url on local host to access it via VPN
- unique url access control
- I found weird email address appended to some of my URLs, what does that mean?
- How to get custom URL routes property_id in wp php plugin?
- index.php shows up in url
- how to remove this #.XsZOUWhKjIU from my wordpress url
- Incorrect page shown
- Cannot Save Changes After Updating URL Settings
- Avoiding the -2 in slugs
- How to encode correclty an url with the char “&” for an email?
- How do i create navigation links like this in wordpress? [closed]
- Blog post Links leading to home page [closed]
- URL Structure for translated articles
- Let WordPress to go opening an external URL
- Change default query parameters
- How do I make images open in a new tab by default?
- problem getting audio url
- Text widget form and URL variables
- wp-login.php ampersand in url results in 404
- How to eliminate the Web Address / Web Link textbox from comment forms
- URL displays different page (a loop)?
- Change path/url of admin-bar.min.css
- Options and template changes not updating
- How do I mitigate the forward slash problem for URLs of images after a WP migration?
- Why is my WordPress install using full server directory paths for media URLs?
- Accidentally Changed WordPress Url
- Typing local WordPress URL works, but clicking the same link does not
- 404 error on cyrillic url
- Block a specific url request
- Dynamic Buttons According to URL parameter
- WordPress Address and Site Address differ
- WordPress URLs changed to relative on transferring server
- /?clearcache=1670318470 showing up in URL after client logs in
- My Website’s Main URL redirects me to an Archive Page