clean url does not work

General questions about CMSimple
sascha
Posts: 20
Joined: Fri Feb 13, 2009 5:49 am

clean url does not work

Post by sascha » Fri Feb 13, 2009 6:29 am

hi guys,

i want to have clean urls for my website http://www.diasdigitalisieren.info. there is a howto in the wiki# http://www.cmsimplewiki.com/doku.php/ti ... /clean_url that i followed. as described i

"1) Edit the file cmsimple/cms.php. Add

Code: Select all

if($cf['urlrewrite']['base']!='')$sn=$cf['urlrewrite']['base'];
on line 88 just above the line which says: // define su - selected url
2) Search for and replace function a() with

Code: Select all

function a($i,$x) {
	global $sn,$u,$cf;
	return '<a href="'.$sn.($cf['urlrewrite']['base']?'':'?').$u[$i].$x.($cf['urlrewrite']['base']?'.html':'').'">';
}
You will find it around line 316 of cms.php.
3) Edit the file cmsimple/config.php. Add at its very end the variable:

Code: Select all

$cf['urlrewrite']['base']="/";
Add it just above the ?> sign. This works only if CMSimple is running in the root of your site. It CMSimple is running in a subdirectory you have to say
$cf['urlrewrite']['base']="/subdirectory/"; instead."

The system is producing clean URLs now, but in a strange way.

the start page http://www.diasdigitalisieren.info opens as usually, but when i go to a h1-subdiretory like "Download" theURL looks like

Code: Select all

http://diasdigitalisieren.info/diasdigitalisieren.info/Download.html
(why two times diasdigitalisieren.info?) and i get the error message "Not Found The requested URL /diasdigitalisieren.info/Download.html was not found on this server." on a blank page.

when i execute the next step of the tutorial

"4) On your workstation generate a file called htaccess.txt. (Windows does not allow to generate a file called .htaccess.) fill this file with:

Code: Select all

RewriteEngine on
# To prevent loop:
RewriteCond %{REQUEST_URI}  !index.php
# Do not rewrite requests to template or images dir:
RewriteCond %{REQUEST_URI}  !templates
RewriteCond %{REQUEST_URI}  !images
# Do not rewrite requests with any query strings:
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^(.*)\.html$ /index.php?$1
Save it and load it on your server into the root or there where CMSimple‘s index.php file resides. Rename the file to .htaccess. (Do not forget the dot in front of name. It wont work without it.) In order to see this file now, your FTP client has to be configured to make hidden files visible."

it does not solve the problem- the only result is, that i get another kind of error message :(

it is now "Fehler 404: Nicht gefunden" but now not on a blank page, but on a kind of shattered version of my site-template. the url of the h1-submenu is still

Code: Select all

http://diasdigitalisieren.info/diasdigitalisieren.info/Download.html
about my system:

1. i'm using CMSIMPLE SE in version 2007g
2. cms.php is protected by cracker tracker http://www.cback.de/cback_software/standalonect.php since my website has been hacked
3. the website is located in a subdirectory on the webserver. there i placed the htaccess-file, too. there is no htaccess file in the root directory.
4. cms.php has access right 644 and config.php has access right 646.

has anybody an idea what i can do next to solve this problem? i searched all three forums now, but could not find a solution.

johnjdoe
Posts: 558
Joined: Tue May 20, 2008 6:32 am

Re: clean url does not work

Post by johnjdoe » Fri Feb 13, 2009 10:37 am

sascha wrote: 2. cms.php is protected by cracker tracker http://www.cback.de/cback_software/standalonect.php since my website has been hacked
Has nothing to do with your problem, but did you try allready the security plugin GXSecurity?

sascha
Posts: 20
Joined: Fri Feb 13, 2009 5:49 am

Re: clean url does not work

Post by sascha » Fri Feb 13, 2009 10:53 am

hi johndoe,
up until now i was not aware of its existence... ;) but thank you for the hint, i checked the website and it looks interesting!
sascha

mikey
Site Admin
Posts: 180
Joined: Tue May 27, 2008 3:15 am
Location: Sydney Australia

Re: clean url does not work

Post by mikey » Fri Feb 13, 2009 11:02 am

this post interests me ;)

clean URl's for what reason ?

surely it cant be for SEO ?

each time i put a template on, google indexes the page with a day or so :) so the existing cmsimple format for page creation can't be the reason for this..

let me know more plz

cheers
mikey

Till
Posts: 337
Joined: Tue May 20, 2008 7:20 am
Location: Germany: Bremen
Contact:

Re: clean url does not work

Post by Till » Fri Feb 13, 2009 11:15 am

sascha wrote:has anybody an idea what i can do next to solve this problem? i searched all three forums now, but could not find a solution.
This may be a server problem. In my hands (see http://www.sonnen-ueberbrille.de) it's running well. Does it run at least up to the first step, where it still shows colons?

Till

sascha
Posts: 20
Joined: Fri Feb 13, 2009 5:49 am

Re: clean url does not work

Post by sascha » Fri Feb 13, 2009 11:55 am

@mikey: it is for SEO and it simply looks better :) i know that this clean URL thing for SEO is discussed controversely, but as nobody ever complained about having clean URLs, i think you are on the safe side using them ;)

@till: i just tried it again

i do step 1)
-> system behaves like before
i do step 2)
-> system behaves like before
i do step 3)
-> i have clean Url now but get an "http: 404 error" plus the url looks strange. i expect it to be like
http://diasdigitalisieren.info/Download.html, but it actually is
http://diasdigitalisieren.info/diasdigitalisieren.info/Download.html

sascha
Posts: 20
Joined: Fri Feb 13, 2009 5:49 am

Re: clean url does not work

Post by sascha » Fri Feb 13, 2009 12:03 pm

to ensure that neither CMSimple SE or the Ctracker (both modify the cms.php) caused the described errors, it tried it with an original and unmodified cms.php from the latest cmsimple version. system behaviour is exactly as described above, though this is not the reason for the error.

Till
Posts: 337
Joined: Tue May 20, 2008 7:20 am
Location: Germany: Bremen
Contact:

Re: clean url does not work

Post by Till » Fri Feb 13, 2009 12:45 pm

You must have done a mistake somewhere. Also: does your provider allow rewrite_mode?

Till

sascha
Posts: 20
Joined: Fri Feb 13, 2009 5:49 am

Re: clean url does not work

Post by sascha » Fri Feb 13, 2009 12:58 pm

@till:
my provider is all-inkl, to my knowledge they support mod_rewrite. i agree with you, that there is an error somewhere, but i have no idea where. i've done the procedure several times now, used first golive and later notepad as an editor. always started fromthe beginning with fresh files, to ensure that there is no legacy error in the documents. i even changed the name of the subdirectory where cmsimple is stored. was identical with the domain name, but that was not the reason, too.

have you, or has anybody else an idea what else i can try?

sascha
Posts: 20
Joined: Fri Feb 13, 2009 5:49 am

Re: clean url does not work

Post by sascha » Fri Feb 13, 2009 1:09 pm

did the same procedure with another domain http://www.sascha-steinhoff.de on the same webspace, still does not work

Post Reply