javascript - check if Url contains special character like #

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

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/wordpress/sample-page, it displays wp page and if visits like mydomain/wordpress/angular/#/sample-page or mydomain/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]
</IfModule>

Now if I visit url like mydomain/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

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745115320a4612092.html

相关推荐

  • javascript - check if Url contains special character like #

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

    7小时前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信