Page 1 of 1

mod_rewrite ,getting the error The system cannot find the file specified.

Posted: Sat Jun 16, 2007 4:23 am
by relic
Hi all, i have searched the forum and wiki and i still cant seem to get it to work,

I am trying to use mod_rewrite (http://www.site.com/page/subpage/
But it brings back "The system cannot find the file specified."

config.php:
#------------
#URL Settings
#------------

#Show mod_rewrite URLs in the menu? You must enable 'use_hierarchy' for this to work for modules
$config['assume_mod_rewrite'] = true;

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

#If you don't use mod_rewrite, then would you like to use the built-in
#pretty url mechanism?  This will not work with IIS and the {metadata} tag
#should be in all of your templates before enabling.
$config['internal_pretty_urls'] = false;

#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'] = false;

#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';

===================================================

.htaccess:

Options +FollowSymLinks
RewriteEngine on
RewriteBase /

# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
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 [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]

===========================================

I have tried everything to try and get this to work, but it dont want to, any help would be apperciated

Cheers
Dave

Re: mod_rewrite ,getting the error The system cannot find the file specified.

Posted: Sat Jun 16, 2007 4:30 am
by Nullig
Have you tried changing:

$config['use_hierarchy'] = false;

to

$config['use_hierarchy'] = true;

Nullig

Re: mod_rewrite ,getting the error The system cannot find the file specified.

Posted: Sat Jun 16, 2007 4:39 am
by relic
hi,

yes i have, i followed the steps shown here http://wiki.cmsmadesimple.org/index.php ... retty_URLs.

strange

Re: mod_rewrite ,getting the error The system cannot find the file specified.

Posted: Sat Jun 16, 2007 8:06 am
by alby
relic wrote: hi,

yes i have, i followed the steps shown here http://wiki.cmsmadesimple.org/index.php ... retty_URLs.

strange
Check this too:
Pretty URLs and mod_rewrite
here
and here

Alby

Re: mod_rewrite ,getting the error The system cannot find the file specified.

Posted: Sat Jun 16, 2007 8:20 am
by relic
Hi thanks for that, but i have already read them..

Re: mod_rewrite ,getting the error The system cannot find the file specified.

Posted: Sat Jun 16, 2007 4:43 pm
by Nullig
Are you sure your account on the server allows you to use .htaccess files?
Can you post a link, so we can see what's happening?

Nullig

Re: mod_rewrite ,getting the error The system cannot find the file specified.

Posted: Sun Jun 17, 2007 5:22 am
by relic
Yes server alows this, i have just checked.

All i am getting is white page that says "The system cannot find the file specified."

Cheers

Re: mod_rewrite ,getting the error The system cannot find the file specified.

Posted: Wed Jun 20, 2007 10:07 am
by Pierre M.
Hello Dave,

"the server allows", but does it work ? Here are some tests :
http://forum.cmsmadesimple.org/index.ph ... l#msg43943
1°)Does your server pass these tests ?

2°)What are your OS and webserver versions ?

3°)Please provide the source of the "white page". There may be more usefull information on it (server xyz on port n...). If you have the Firefox webdevelopper toolbar, please copy paste the result of Information -> View Response Headers.

4°)Is trailing slashes the URL scheme you really want instead of /some/pretty/url.html ?

5°)How is your site doing with pretty URLs turned off ?

Pierre M.

Re: mod_rewrite ,getting the error The system cannot find the file specified.

Posted: Wed Jun 27, 2007 10:22 am
by raul.lnx
Hi:

I have installed mod_rewrite in my webpage, and it seems to work very web, but now there are anothers problems.


Into config.php
------------------------------------------------------------------------------------------------------
$config['assume_mod_rewrite'] = true;
$config['internal_pretty_urls'] = false;
$config['use_hierarchy'] = true;
$config['page_extension'] = '.html';
------------------------------------------------------------------------------------------------------


into /.htaccess   

------------------------------------------------------------------------------------------------------


Options +FollowSymLinks
RewriteEngine on
RewriteBase /

# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
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 [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]


#con extension
RewriteRule ^noticias/([0-9]*)/([0-9]*)/(.+).html$ index.php?mact=News,cntnt01,detail,0&cntnt01articleid=$1&cntnt01returnid=$2 [NC,L]
RewriteRule ^(.+).html$ index.php?page=$1 [QSA]


------------------------------------------------------------------------------------------------------

PROBLEMS DETECTED:

I have 2 personal errordocument into my root path:
/notfound.html  and /forbidden.html and they are called by my .htaccess :


#
ErrorDocument 404 /notfound.html ( this "solved" non-elegant solution writting the html code into admin->config general )
ErrorDocument 403 /forbidden.html


For example, if I write in web-browser : htttp://www.snowboard-zamora.net/fake.html , it must be redirect to /notfound.html , but the server shows “not found” because ... ( i think it is trying to open /index.php?=fake.html )

How can I solve this error ???


OTHER PROBLEM , THE BIG PROBLEM !!!!!!!

Since i’have installed mod_rewrite, i can’t edit, create NEWS ..... Into iframes in admin pannel shows “not found” .......

If I disabled FCKEditorX, i can edit news, with html code, but if I enable it, appears "not found" .....

Anyone knows to solve this problems ??

My webpage is : www.snowboard-zamora.net


THANKS

Re: mod_rewrite ,getting the error The system cannot find the file specified.

Posted: Wed Jun 27, 2007 1:20 pm
by Pierre M.
raul.lnx wrote: I have 2 personal errordocument into my root path:
/notfound.html  and /forbidden.html and they are called by my .htaccess :

ErrorDocument 404 /notfound.html ( this "solved" non-elegant solution writting the html code into admin->config general )
ErrorDocument 403 /forbidden.html

For example, if I write in web-browser : htttp://www.snowboard-zamora.net/fake.html , it must be redirect to /notfound.html , but the server shows �not found� because ... ( i think it is trying to open /index.php?=fake.html )

How can I solve this error ???
Hello,

I think you are right, mod_rewrite rewrites /fake.html to /index.php?page=fake (or.html)
You may like the CMSms builtin 404 error handling. It is in Site Admin -> Global settings in the admin. Just copy the HTML code of your existing notfound.html page in the textbox and activate the checkbox.

Pierre M.

Re: mod_rewrite ,getting the error The system cannot find the file specified.

Posted: Fri Jun 29, 2007 6:21 pm
by raul.lnx
Ok. That error I solved last day ...... but the man problem is the FCKEditorX. With mod_rewrite/pretty_urls actuvated, i can't edit news and pages ..... It shows "not found" ???into the iframe of FCKEditor?? ..... ( The toolbar not appers, only a iframe below ) .....


WOWWWW, it's solved with this lines into .htaccess !!!!!

-----------------------------------------------------------------------------------

Options +FollowSymLinks
RewriteEngine off

-----------------------------------------------------------------------------------