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

Help with getting the CMS CORE package up and running. This does not include 3rd party modules, PHP scripts, anything downloaded via module manager or from any external source.
Locked
DivineDiva
New Member
New Member
Posts: 5
Joined: Thu Oct 01, 2009 9:10 pm

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

Post 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';
Last edited by DivineDiva on Sun Mar 14, 2010 8:30 pm, edited 1 time in total.
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

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

Post 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
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
owr_bgld

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

Post 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.
DivineDiva
New Member
New Member
Posts: 5
Joined: Thu Oct 01, 2009 9:10 pm

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

Post 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
Attachments
subfolder.jpg
DivineDiva
New Member
New Member
Posts: 5
Joined: Thu Oct 01, 2009 9:10 pm

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

Post 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
owr_bgld

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

Post 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
DivineDiva
New Member
New Member
Posts: 5
Joined: Thu Oct 01, 2009 9:10 pm

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

Post by DivineDiva »

owr_bgld.

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

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

Post 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
Locked

Return to “[locked] Installation, Setup and Upgrade”