• Resolved zeiddev

    (@zeiddev)


    I have a certificate on the root of my domain so that I am able to make https calls on it without browsers complaining and saying that it is not secure. However I now need to host a webservice on my domain that needs to be secure too. Previously I have just used a subdomain with http.

    Is there a way of telling WordPress to ignore calls to https://www.example.com/webservice and all others to treat as part of the standard WordPress processing i.e. the showing of posts and pages?

    Thanks

    David

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi David,

    If you are using apache httpd web server (you probably are) then you can make a change to the .htaccess file in your site root to help with this.

    You’ll probably find the standard .htaccess file to read:
    # 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

    Back up the .htaccess file first in case something weird happens.
    Then add a line under the first RewriteRule line, so your .htaccess reads as such:

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

    Note, the “webservice” is specific to your question. You can change that to whatever ignored directory name you need. You can also specify multiple directories if you need to, such as:
    RewriteCond %{REQUEST_URI} !^/(webservice|anotherservice|bob/.*)$

    Let me know if this works out.

    Thread Starter zeiddev

    (@zeiddev)

    That works perfectly. Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Root url used for WordPress and other non-wordpress pages’ is closed to new replies.