• I am having some difficulty launching my wordpress site in development (which in running on a Bitnami stack on MAC OS X 10.10) since following various similar instructions in an attempt to rid myself of the /wordpress/ suffix to my URL. I’ve followed all the advice on this subject on the net to the letter, aklthough its somewhat conflicting and even looked into whether by Bitnami stack could be part of the proeble,

    My directory structure may be a bit unusual I don’t know. Unfortunately the bitname.conf app has never launched and I’ve has to try and so it manually. 2 days later I’m despearate and begging for help

    /Applications/wordpress-4.2.2-2/apps/wordpress/htdocs was the original location of my index.php and .htaccess files.

    Apache’s root is /Applications/wordpress-4.2.2-2/apache2 and off this is /conf which contains the primary Apache config file httpd.conf.

    This appears to set the web server root directory to <Directory “/Applications/wordpress-4.2.2-2/apps/wordpress/htdocs”> and Includes the file “/Applications/wordpress-4.2.2-2/apps/wordpress/conf/.htaccess.conf” which itself just references some third-party plugins.

    Also in the dir wordpress/conf is the file in http-app.conf which:
    1. Repeats the Apache config file httpd.conf by asserting that the DocumentRoot is “/Applications/wordpress-4.2.2-2/apache2/htdocs”
    2. Includes the SSI directory which I am not using.
    3. Includes conf/deflat.conf which contains some AddOutputFilterByType directives which appear to instruct the web server to compress certain file types.
    4. Correctly sets the location of php.ini: PHPIniDir “/Applications/wordpress-4.2.2-2/php/etc”
    5. Includes “/Applications/wordpress-4.2.2-2/apache2/conf/bitnami/bitnami.conf

    In turn bitnami.conf again
    1. Sets DocumentRoot “/Applications/wordpress-4.2.2-2/apache2/htdocs”
    2. Includes “/Applications/wordpress-4.2.2-2/apache2/conf/bitnami/bitnami-apps-prefix.conf”
    3. Includes “/Applications/wordpress-4.2.2-2/apache2/conf/bitnami/bitnami-apps-vhosts.conf”

    As it’s a native install I’m not using bitnami-apps-vhosts.conf but instead I will follow the trial to bitnami-apps-prefix.conf which contains the directives:

    Include “/Applications/wordpress-4.2.2-2/apps/wordpress/conf/httpd-prefix.conf
    Include “/Applications/wordpress-4.2.2-2/apps/phpmyadmin/conf/httpd-prefix.conf”

    Moving on…the wordpress version of httpd-prefix.conf contains the directives:

    Alias /wordpress/ “/Applications/wordpress-4.2.2-2/apps/wordpress/htdocs/”
    Alias /wordpress “/Applications/wordpress-4.2.2-2/apps/wordpress/htdocs”

    Include “/Applications/wordpress-4.2.2-2/apps/wordpress/conf/httpd-app.conf”

    STEP 1:
    I commented out the aliases in this file as advised by https://wiki.bitnami.com/Components/Apache

    STEP 2:
    Next I COPIED index.php from htdocs to what https://www.wpbeginner.com instructions is the root wordpress folder, namely the “parent folder with the wordpress folder in it”. In my case this is “/Applications/wordpress-4.2.2-2/apps/ and changed the file configurations from:

    require( dirname( __FILE__ ) . 'wp-blog-header.php' );

    to

    require( dirname( __FILE__ ) . '/wordpress/htdocs/wp-blog-header.php' );

    STEP 3
    Fristly I commented out global constants that relied on the “/wordpress” alias in wp-config.php to

    /*define(‘WP_SITEURL’, ‘https://&#8217; . $_SERVER[‘HTTP_HOST’] . ‘/wordpress’); */
    */define(‘WP_HOME’, ‘https://&#8217; . $_SERVER[‘HTTP_HOST’] . ‘/wordpress’); */

    STEP 4
    This enabled me to amend the Site URL field via the wp-admin dashboard general settings from:

    https://www.mydomain.com:8080/wordpress

    to

    https://www.mydomain.com:8080

    leaving the WordPress URL as https://www.mydomain.com:8080/wordpress

    ….hmmm without the ‘wordpress’ alias to the Absolute path suffixing the domain it wouldn’t work – unless Apache took notice of any of the Directory or DocumentRoot conf entires which pointed to the same URL Site root.

    STEP 5
    The .htaccess file which was in apps/wordpress/htdocs I COPIED to the “parent folder of the wordpress folder”: ‘apps’. Now the original configurations in this look odd because the htdocs file had the index.php in so why it is referencing it is a wordpress subdirectory when wordpess is its parent dir.

    At first I though it was because ‘wordpress’ has been aliased to the absolute Path /Applications/wordpress-4.2.2-2/apps/wordpress/htdocs. But I’m not sure if Aliases substitutions are only effective in a URL or whether they will be transposed in config files and php files. Presumably NOT, else many of the absolute paths declared like “/Applications/wordpress-4.2.2-2/apps/wordpress/htdocs” would be transposed erroneously to “/Applications/wordpress-4.2.2-2/apps/Applications/wordpress-4.2.2-2/apps/wordpress/htdocs/htdocs”

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

    Therefore I assume it was not being used and according to Bitnami the content of the “.htaccess” files have been moved to the following file: <installdir>/apps/application_name/conf/htaccess.conf

    However this file also referenced ‘wordpress’ so following its directions I removed it from the RewriteBase and in addition changed the RewriteRule to reference the current directories index.PHP

    RewriteEngine On
       RewriteBase /
       RewriteRule ^index\.php$ - [S=1]
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteRule /index.php [L]

    The behavior though is that if I surf https://www.mydoamin.com:8080 I Apache serves me the default wordpress index.html from its root directory. IF I try and specify the absolute path from root to site URL directory it just says can’t find file. Ditto now when I try to and load an admin file in wp-admin. If I put the full absolute path the site url dir after my domain I just get URL not found.

    I am not getting anything helpful in the, access, errors, debug logs from Apache or Workpress, except that its not getting very far cause I’m not getting any PHP debug such as that I’ve put in index.php and wp-config.php. What I don’t understand is
    A) How Apache knows where to get the domain mapping from: I’ve got https://www.mydomain.com mapped to 127.0.0.1 in the etc/private/hosts file but I’m pretty sure this is for the Apache instance that comes built into MAC OS X, while Bitnami is meant to be self contained.
    B) How Apache knows that the ‘parent of the wordpress’ dir in the wordpress root and where it should look for .htaccess and index.php. I can’t see any reference to my root: /Applications/wordpress-4.2.2-2/apps.
    C) Why a fully qualified absolute path typed into the browser URL doesn’t work?

    Can you spot anything I’ve done wrong or can you suggest a way around it like for example Moving to Virtual Hosts or adding the site URL root into the hosts file? Any suggestions much appreciated cause well and truly stuck.

  • The topic ‘Another dull how to remove /wordpress/ from the URL SNAUFU’ is closed to new replies.