Rewriting a URL outside of WordPress Root
-
My wordpress blog is installed at
domain.com/blog
and I have a page with subpages whose structure look likedomain.com/blog/page
anddomain.com/blog/page/subpage
.I want my visitors to be able to go to
domain.com/subpage
and see the content ofdomain.com/blog/page/subpage
without being redirected to that URL externally, avoiding wordpress permalink rewrites.I tried using
RewriteRule ^subpage$ /page/subpage [L]
and the content is being served, but the url looks likedomain.com/blog/page/subpage
(I’d guess WordPress permalinks are getting to it.).htaccess under
/blog
:# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteRule ^index\.php$ – [L]// tried inserting my code here.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule># END WordPress
.htaccess under
domain.com
:<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>RewriteCond %{HTTP_HOST} ^domain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.domain.com$Should I be focusing on wp_rewrite? non_wp_rewrite? Thanks!
- The topic ‘Rewriting a URL outside of WordPress Root’ is closed to new replies.