Welcome Guest, Not a member yet? Register   Sign In
Wordpress in root
#1

[eluser]adammm[/eluser]
Hi,

I have searched the forums and found numerous topics on this same issue, however I just can not get this to work.

I have wordpress installed in the root directory.

I want to install a CI custom script in /newsletter

I have managed to get this working by adding a rewriteurl before the wordpress htaccess

However as soon as i add a .htaccess file in /newsletter wordpress then trys to run the url.

I want to password protect the CI directory /newsletter

any help would be appreciated
#2

[eluser]KingSkippus[/eluser]
Post the .htaccess you have. It's easier to spot what's wrong with yours than to try to create a new one from scratch. Make sure to enclose it in [code][/code] tags to make it easy for us to read. Wink
#3

[eluser]pickupman[/eluser]
The only thing should have to is exclude the CI folder in your wordpress .htaccess in your document root
Code:
RewriteCond %{REQUEST_URI} !^(newsletter)

This code right above the RewriteRule line. Take note, that if you have this file writable so wordpress and change it from the admin panel, a user could accidentally remove this line.
#4

[eluser]adammm[/eluser]
Adding that line above works yea, but only up until i place a .htaccess file into the newsletter folder.
#5

[eluser]pickupman[/eluser]
doesn't work, doesn't help us. Like the KingSkippus mentioned, post both of your .htaccess files here so, we can help. .htaccess works from the bottom up (subfolders up to document root). It will keeping going up the directory tree to find a .htaccess file, but should stop if one is found and valid.
#6

[eluser]adammm[/eluser]
Code:
AuthName "Restricted Area"
AuthType Basic
AuthUserFile "/home/predator/.htpasswds/public_html/newsletter/passwd"
require valid-user

this is the file in my /newsletter directory

Code:
ErrorDocument 401 default

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

</IfModule>

# END WordPress

and this is my main file. I removed that line you said because it didnt work when i tried it.
#7

[eluser]pickupman[/eluser]
Will it work without the authentication block of statements? The code looks like it should be working. Change my line to in your main (wordpress) .htaccess file:
Code:
ErrorDocument 401 default

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

I have this in a website that I am running a the same idea, not CI, but another php script in a subfolder of a wordpress isntall. You need to get both running together, and then try password protecting it.
#8

[eluser]adammm[/eluser]
I can get them running together no problem. but as soon as i try to password protect it, it is no longer recognized.

wordpress takes control of the url as soon as it has a htaccess file in the subdirectory, for some odd reason
#9

[eluser]pickupman[/eluser]
I am not an apache expert, but it seems like this would be caused by the validation process. Somehow the directives are ignored when authentication is added into the mix. If this is the case, why not just require a session login via CI into your newsletter app.
#10

[eluser]adammm[/eluser]
that is what i have decided to do. i give up with apache




Theme © iAndrew 2016 - Forum software by © MyBB