SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Jul 2009
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Want to use a url that is outside of wordpress folder

    Guys I need help.

    I installed wordpress in a subdirectory (everything is working) but created another directory (subdirectory) that is outside of wordpress directory. I get a 404 error when I try access the directory url. for example;

    My wordpress installation is in Wordpress directory (sub directory) www.example.com/wordpress, I moved the .htacess to the root directory in order for to access wordpress using www.example.com. Everything works fine except that I created a facebook app that I placed in a different directory called Facebook, and gets a 404 error when I try to access the facebook app using www.example.com/facebook. Any ideas on how to resolve this?

  2. #2
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    8,897
    Mentioned
    138 Post(s)
    Tagged
    2 Thread(s)
    In order to answer your question, could you please post the (complete) .htaccess you're using right now?
    Rémon - Hosting Advisor

    Minimal Bookmarks Tree
    My Google Chrome extension: browsing bookmarks made easy

  3. #3
    SitePoint Member
    Join Date
    Jul 2009
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks ScallioXTX, below is the .htaccess that I have.

    <Files ~ "^.*\.([Hh][Tt][Aa])">
    order allow,deny
    deny from all
    satisfy all
    </Files>


    IndexIgnore *

    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?example.com/.*$ [NC]
    RewriteRule \.(gif|jpg|js|css)$ - [F]

    # 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

  4. #4
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    8,897
    Mentioned
    138 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by okam View Post
    <Files ~ "^.*\.([Hh][Tt][Aa])">
    order allow,deny
    deny from all
    satisfy all
    </Files>
    This should be part of the main server configuration. It doesn't hurt to have it here, but if it's also in the main server config (which you can test by removing it from your htaccess and see if you can access www.yourwebsite.com/.htaccess) I'd remove it to avoid the server having to do the same thing twice for each and every request -- which is just a waste of resources.

    Quote Originally Posted by okam View Post
    <IfModule mod_rewrite.c>
    You don't need this. Once you've established mod_rewrite works there is no need to keep asking apache over, and over, and over again -- again, a waste of resources (WordPress's fault -- not yours).

    Quote Originally Posted by okam View Post
    RewriteEngine On
    You already had that, no need to start it twice

    Quote Originally Posted by okam View Post
    RewriteBase /
    You don't have any aliases (mod_alias), so unless your host is set up very weirdly you don't need this -- remove it, and when everything breaks down, put it back.

    Quote Originally Posted by okam View Post
    </IfModule>
    Remove this is as well, as it closes something we removed before.

    So:
    Code:
    IndexIgnore *
    
    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?example.com/.*$ [NC]
    RewriteRule \.(gif|jpg|js|css)$ - [F]
    
    # BEGIN WordPress
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    # END WordPress
    There, that's better

    As for your question, I don't see anything in there that would screw that up. Are you sure you use the correct case when requesting the URL? (In your OP you mentioned you have a directory Facebook and that www.yourdomain.com/facebook doesn't work -- as *nix is case sensitive, these are not the same)
    Rémon - Hosting Advisor

    Minimal Bookmarks Tree
    My Google Chrome extension: browsing bookmarks made easy

  5. #5
    SitePoint Member
    Join Date
    Jul 2009
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks ScallioXTX. You solved my issue. It was a case sensitive issue just like you noted at the end of the post. I also cleaned up the codes. Thanks again. I appreciate your help.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •