Page 1 of 1

[SOLVED] Pretty URLs: index.php file not found 404 Error

Posted: Sun Mar 14, 2010 10:32 am
by DivineDiva
Some one please help! ??? ???
______________________
ERROR:
Not Found
The requested URL /index.php was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/1.3.41 Server
___________________

I have been reading through the forums and trying what everyone is saying but I am still having the same problem.  My site is hosted on LunarPages and according to them mod write is already on in Apache so all I need to do is edit my .htaccess file.  Here is the code I have:

.htaccess

 Options +FollowSymLinks
 RewriteEngine on
 RewriteBase /

 # 301 Redirect all requests that don't contain a dot or trailing slash to
 # include a trailing slash
 # except for form POSTS
 RewriteCond %{REQUEST_URI} !/$
 RewriteCond %{REQUEST_URI} !\.
 RewriteCond %{REQUEST_METHOD} !POST$
 RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]

 # Rewrites urls in the form of /parent/child/
 # but only rewrites if the requested URL is not a file or directory
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule ^(.+)$ index.php?page=$1 [QSA]




config.php

#------------
#URL Settings
#------------

#What type of URL rewriting should we be using for pretty URLs?  Valid options are:
#'none', 'internal', and 'mod_rewrite'.  'internal' will not work with IIS some CGI
#configurations. 'mod_rewrite' requires proper apache configuration, a valid
#.htaccess file and most likely {metadata} in your page templates.  For more
#information, see:
#http://wiki.cmsmadesimple.org/index.php ... ty_URL.27s
$config['url_rewriting'] = 'mod_rewrite';

#Extension to use if you're using mod_rewrite for pretty URLs.
$config['page_extension'] = '';

#If you're using the internal pretty url mechanism or mod_rewrite, would you like to
#show urls in their hierarchy?  (ex. http://www.mysite.com/parent/parent/childpage)
$config['use_hierarchy'] = true;

#If using none of the above options, what should we be using for the query string
#variable?  (ex. http://www.mysite.com/index.php?page=somecontent)
$config['query_var'] = 'page';

Re: Pretty URLs: index.php file not found 404 Error

Posted: Sun Mar 14, 2010 10:42 am
by Rolf
Hi DivineDiva,

- Do you have the {metadata} tag in your template?
- Is your website placed in a subfolder?
- Do you have an url for us (pm)

Regards, Rolf

Re: Pretty URLs: index.php file not found 404 Error

Posted: Sun Mar 14, 2010 11:44 am
by owr_bgld
I had the same problem with this .htaccess - by searching lont time I found the solution for my server in this way:

Code: Select all

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
That's all I have in the .htaccess and it works pretty. The first part of the 301-Redirect from your htaccess also caused troubles with my page.

Info about the [NC]-flag:
Use of the [NC] flag causes the RewriteRule to be matched in a case-insensitive manner. That is, it doesn't care whether letters appear as upper-case or lower-case in the matched URI.

Re: Pretty URLs: index.php file not found 404 Error

Posted: Sun Mar 14, 2010 7:12 pm
by DivineDiva
Thanx for the replies.

owr_bgld - I changed my .htaccess but still have the problem so I think I have something else wrong.

Rolf -
1.. Yes I have the {metadata} tag in the head of my template.  All is says is {metadata}, do I need to add anything else.

2.. Is the website in a subfolder - yes
      public_html
        2ndgen (this houses all the files for CMS Made Simple.  this is where my index.php file is housed)


3.. http://youthguidance.net/2ndgen/default_templates/
    this is just one of the pages that came with installing CMS Made simple.  I wanted to make sure I can get the pretty URLs before I start with my own templates

Re: Pretty URLs: index.php file not found 404 Error

Posted: Sun Mar 14, 2010 7:16 pm
by DivineDiva
Rolf - here is the main url  http://youthguidance.net/2ndgen/

when you click the tabs thats when it states index.php not found

Re: Pretty URLs: index.php file not found 404 Error

Posted: Sun Mar 14, 2010 7:34 pm
by owr_bgld
public_html normaly isn't a "real" subfolder - it's the folder where the domain points to
but you have your cms in the subfolder /2ndgen

Try to put the .htaccess in the subfolder /2ndgen - normally it should work and you can also see the actual page

Re: Pretty URLs: index.php file not found 404 Error

Posted: Sun Mar 14, 2010 8:09 pm
by DivineDiva
owr_bgld.

You are the best!! That was it, thank you sooooo much.  That was stalling my project for a client.

Re: Pretty URLs: index.php file not found 404 Error

Posted: Sun Mar 14, 2010 8:26 pm
by owr_bgld
You're welcome - but it was easy because Rolf asked the right yuestions ;)

Can you please put [Solved] at the title of the Topic