I have site setup in wordpress as root folder like /wordpress and one angular site setup in sub folder /wordpress/angular.

Currently if user visits url like mydomain.com/wordpress/sample-page, it displays wp page and if visits like mydomain.com/wordpress/angular/#/sample-page or mydomain.com/wordpress/angular/#/parent-page/child-page, it displays angular page.

After #/, whatever it is, it should stay on angular page. Currently it is staying, but angular in url should not be shown

I want to remove angular from url if user visits angular page.

So, I put .htaccess file in wordpress folder like this

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/
RewriteCond %{REQUEST_URI} !(.*)angular
RewriteRule ^(.*)$ angular/$1 [L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]

Now if I visit url like mydomain.com/wordpress/#/any-url, it should stay on angular' page but not working.

I guess I need to check if url contains #, then make it redirect to angular folder. As it is a special character, how to make some condition on above code.

I am taking ref from



I am not much expert on htaccess config. So any help will be appreciated.

I am using WP version 5.2.3 and Angular 6.x

  • 3
    This isn't possible, the # part of the URL is never sent to the server, it's only available to the browser, that's why hashbang URLs such as #/page are used in older JS based web UIs. This is intended as it's a part of the HTTP spec. You could look for the character on the server but you would never see it
    – Tom J Nowell
    Oct 1 '19 at 15:06
  • 2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.