/    Sign up×
Community /Pin to ProfileBookmark

.htaccess not always working

My site’s index.php file is in a /site/ subdirectory so my .htaccess file instructs requests to redirect to pages in that directory. All seems fine from my PC and others but I have also tested it on other computers (on different networks) and the redirect doesn’t happen, instead users get a file list including the /site/ subdirectory.

.htaccess file below…

# BEGIN WordPress

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

# END WordPress

Why is this happening? Is there a workaround so it doesn’t happen i.e. can I put an index.php file in the root folder that redirects to /site/index.php?

Thanks in advance
Dan

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@DasherJul 16.2012 — Not sure about all of your directives in .htaccess.

But you might add:

DirectoryIndex index.php index.html
×

Success!

Help @danleach spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...