0

I got a hosting with WordPress engine installed and inside the root of WP engine folders I've created another web application which is having problems with URLs containing .profile word. When this text is added to URL I'm always receiving 404 error.
Here's an example:
WordPress blog URL: https://mainsite.com
Sub web application folder name: webapp
Sub web application access URL: https://mainsite.com/webapp/
So, when I try to access URL like this: https://mainsite.com/webapp/login.php?code=user.profile I'm receiving error 404. At the same time URL like this: https://mainsite.com/webapp/login.php?code=user.profilb is working fine (2nd URL got last letter replaced by another symbol).
I think this is an issue with WordPress default mod_rewrite settings, here they are:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

I got no clue at all why this could happen with .htaccess file like this. Could you suggest please?

WhiteAngel
  • 2,594
  • 2
  • 21
  • 35
  • See @phyzome comment [link]https://stackoverflow.com/questions/3856693/a-url-resource-that-is-a-dot-2e – Jamie_D Sep 15 '18 at 16:50
  • This ".profile" can be anywhere. I just removed all unnecessary parts of the URL to be easier to understand the issue. I've slightly updated original url, so it's clear that variable is not starting from dot but can be in any part of the url. – WhiteAngel Sep 16 '18 at 06:01
  • DId you register the query var in your functions.php file? [link]https://codepen.io/the_ruther4d/post/custom-query-string-vars-in-wordpress – Jamie_D Sep 16 '18 at 12:03
  • @Jamie_D I don't need URL with ".profile" part to be parsed by WordPress at all. I need it to be properly redirected to sub-folder web-app. – WhiteAngel Sep 19 '18 at 04:55

1 Answers1

0

It turned out that the issue was with mod_security of a2hosting. They were blocking all sensitive linux files and folders, like: .profile, .htaccess, .bashrc...
Hope, this will help someone.

WhiteAngel
  • 2,594
  • 2
  • 21
  • 35