I'm obviously doing something wrong, but have been unable to isolate the problem.
I have N-13 installed in the /news directory so the path to the news file is domain.com/news/index.php.
I have links to the news file installed on domain.com/index.php and domain.com/blog.php
My .htaccess file is located in my root directory and says:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .*/index.php [L]
My N-13 admin panel has Friendly URL's enabled
File extension: .php
Prefix: /news/
Directory filename: index.php
When I click on Full Story I get:
http://domain.com/news/CorrectFriendlyURL.php but it's a 404. I tried removing the /news/ prefix and various other changes, but I can't get past some variation on the 404 error.
Edit: I forgot to mention that my .htaccess file is in the /htdocs folder but my domain is in htdocs/domainname/
So my question is how should I set these parameters?
At first I had it in my /htdocs folder. But I just now also put it in my /htdocs/domainname/ folder. Still got a 404 - with a friendly URL.
Then, just to try everything I could think of, I removed
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .*/index.php [L]
from the one in the /htdocs folder but left it in the one in the /htdocs/domainname/ folder. Still no joy. The URL was:
http://www.domainname.com/news/5-0-How-much-Vitamin-D-do-you-really-need.php but the error said:
The requested URL /~2424045.2657060/htdocs/domainname/news/5-0-How-much-Vitamin-D-do-you-really-need.php was not found on this server.
It seems so close, but obviously not right. I hope you have an idea of what's wrong.
Thanks.
Access: Admin
Total Posts: 1395
Joined: 2006-05-19
Below the "RewriteEngine On" line, try adding the following
Code:
RewriteBase /
I'm reading a couple different sites regarding how network solutions handles .htaccess files weirdly, some of them suggest adding the RewriteBase line whilst others say it did nothing so it's worth a try.
This is really driving me nuts, Chris. I've been fiddling with various parameters trying to get it to work. It might be partly that I have my site installed in a subdir of my root. I don't have anything pointing to my root folder, but several subdirs with domains pointing to them. So my root dir is /htdocs/ but this site is in htdocs/spyglasshill/ and the N-13 files are installed in htdocs/spyglasshill/news.
Realizing that, and that my blog page is in htdocs/spyglasshill/blog.php, tell me if what I'm doing seems correct to you:
My .htaccess is in my /htdocs/ folder and says:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .*/spyglasshill/blog.php [L]
I do believe that the /htdocs/ folder, not /htdocs/spyglasshill/ is correct because I wanted a custom 404 error message for another site and even though the domain pointed to that specific subdir, the .htaccess had to be placed in the /htdocs/ folder for it to work. For the sake of eliminating other variables, I've removed the custom 404 code from the .htaccess file and it only contains what's above.
Without Friendly URL's turned on, clicking on Read More displays the correct page and the URL is http://www.spyglasshill.com/blog.php?id=2
Then I set my N13 admin page to:
Enable Friendly URLS: Yes
File Extension: .php
Prefix: /news/
File: index.php
With Friendly URL's turned on, there is a 404 and the URL is:
http://www.spyglasshill.com/news/2-0-The-Power-of-the-Placebo-on-Pharmaceuticals.php
So I removed the /news/ prefix from my N13 admin (even though it seems it should be there) and then clicking on Read More gives a 404 and the URL is:
http://www.spyglasshill.com/2-0-The-Power-of-the-Placebo-on-Pharmaceuticals.php
which I would think should display the page, not a 404. But I'm not really sure what a functioning Friendly URL is supposed to look like since I've never been able to get one.
I hope you have some ideas. I really want this to work.
Thank you.
Access: Admin
Total Posts: 1395
Joined: 2006-05-19
Pretty much everything you've listed is what I would suggest to try and get it working. Only thing I can think of doing is if you give me access to the server I can play around with it to see if I can find out what's going on.
Thank you so much for helping get this to work Chris. I would never have thought of what you did, and honestly am not sure why some of it makes a difference. But I'm so happy to have it working correctly!