WordPress.org

Ready to get started?Download WordPress

Forums

.htaccess help! (7 posts)

  1. daschman
    Member
    Posted 7 years ago #

    I have the .htaccess file from wordpress in my website root directory since wordpress is installed in a subdirectory. I also want to have a php upload form on my site but I cannot do this without modifying the .htaccess file in the root directory. Since the .htaccess already exists, how can I use two bits of code that each have to be in the htaccess file? Thanks, D

  2. Glenn Ansley
    Member
    Posted 7 years ago #

    You can have more than one .htaccess if they're in different folders. Did you try to put the second one in the WP folder? It might work.

    If not, you could combine the contents of both files into one with a text editor.

  3. daschman
    Member
    Posted 7 years ago #

    I tried putting both blocks of code in the same .htaccess file and then it messes up my wordpress site.

    How would I go about separating the blocks so that wordpress works fine as well as my php.ini config code for a php upload form?

  4. Chris_K
    Member
    Posted 7 years ago #

    I'm probably confused, so forgive me if I'm stating the obvious here.

    1) Your WP .htaccess file should be in the WP directory (you mention WP is in a subdirectory above -- put it there).

    2) php.ini file contents don't go in ANY .htaccess file directly.

  5. daschman
    Member
    Posted 7 years ago #

    To have my WP blog run from my website root directory, I transferred the .htaccess and the index.php files from the subdirectory WP is installed in to the webroot (as instructed on the option/configuration page).

    Additionally, I wrote a php upload form for my site. I had to configure the php.ini file to allow file access on my site so I could transfer files from the temp directory on the apache server to a directory in my website. After configuring the php.ini file I was instructed to drop this block of code into a .htaccess file on my webroot:

    Options +ExecCGI
    AddHandler php-cgi .php
    Action php-cgi /cgi-bin/php.cgi

    Therein lies the problem. The .htaccess already exists from WP with the following contents:

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

    # END WordPress

    If I put both blocks of code in the .htaccess file (regardless of the order), my WP page can't load.

    So how can I keep the functionality of my WP blog to not run off of the subdirectory (www.site.com/wordpress) but also put in the new code for my php upload form?

  6. Glenn Ansley
    Member
    Posted 7 years ago #

    You lost me with the php upload file and the php.ini. I'm afraid I don't know what you're trying to do. Maybe HandySolo will understand.

  7. daschman
    Member
    Posted 7 years ago #

    Does anyone else have any thoughts regarding my previous posts?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags