• I want to clear on one thing. here is the actual scenerio ,if anyone can help me in:

    1. We have a domain e.g. abc.com and its has one open source application running without any issue
    2. we have a subfolder there e.g. NewSite
    3. Now in folder NewSite, I want to install wordpress which is fine
    4. but I want to place a code in main root folder in htaccess file which actually takes user to land on NewSite folder website but keep the url abc.com, however, abc.com can be access with special url like https://www.abc.com/index.php/syx
    5. Here is the code which is working but I am confused on what would be the permalink of wordpress in actual? Hope this clear my question. (Since browse apparent url will be ab.com but what would be the actual url when I edit the pages in wp?)

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^(www.)?abc.com$
    RewriteCond %{REQUEST_URI} !^/NewSite/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /NewSite/$1
    RewriteCond %{HTTP_HOST} ^(www.)?abc.com$
    RewriteRule ^(/)?$ NewSite/index.html [L]

    • This topic was modified 11 months, 3 weeks ago by May I Know.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    what would be the permalink
    what would be the actual url

    The concept of permalink only applies to CMS managed content like posts and pages, not to back end resources like editors. A post’s permalink will be whatever you set in settings for site and home URLs. In your example abc.com will work. But back end resources need to include /NewSite/ since they are actual .php files and not CMS managed content.

    I suggest removing the not file or folder conditions (!-f, !-d) so all abc.com requests except /syx are redirected to /NewSite/. Then the usual WP .htaccess code can reside in /NewSite/

    This can all be better manged with Virtual Host. You may not have direct access to this, but your need can likely be addressed through your host’s subdomain and add-on domain settings. For example, syx.abc.com could be directed to your other app. https://www.abc.com and abc.com could be directed to /NewSite/. The default WP .htaccess code would still reside in /NewSite/

Viewing 1 replies (of 1 total)
  • The topic ‘htaccess while wordpress is hosting in subfolder’ is closed to new replies.