• I am developing a plugin
    with plugin activation hook, It creates a .htaccess file dynamically in wp-content directory.

    If website url is example.com then
    in my .htaccess file I write a line : RewriteBase /wp-content/mydir

    but when website url is example.com/blog/ then I have to write in .htaccess : RewriteBase /blog/wp-content/mydir

    Now my question , how can I detect this directory name ‘blog’

  • The topic ‘How to detect if WP is installed in a sub directory ?’ is closed to new replies.