View Full Version : a problem about two salsh in post id "//"

yosri algharawy
02-01-2012, 11:57 AM
my article's directory url was without post ID
i found this code in core.php file

$Article->url = $Article->Category->url.$Article->urltitle.'.'.$this->db_settings['url_extension'];

and changed it to

$Article->url = $Article->Category->url.'/'.$Article->id.'/'.$Article->urltitle.'.'.$this->db_settings['url_extension'];

this mean that i added




so, ID displayed but after two slash "//"


when i delet


that before


the url not work and give me the missage

page can't be found

02-01-2012, 03:51 PM
What is the code you currently have?

yosri algharawy
02-01-2012, 09:36 PM
i have now the seconed code, please check the example

02-01-2012, 10:26 PM
No. You said you deleted '/' from it. Is that second block including it or after you deleted it?

yosri algharawy
02-01-2012, 10:55 PM
i delet it to test if will work or no, i find it not working and gives me the message "page can not be found", so i have to return it.
now "/" already exist.
the problem is how to remove it and keep the link working

02-01-2012, 11:03 PM
It looks to me like this will work:

$Article->url = $Article->Category->url . $Article->id . '/' . $Article->urltitle . '.' . $this->db_settings['url_extension'];

yosri algharawy
02-02-2012, 08:44 AM
i placed your code but not work
check now

but it works with two slashs


i attached you the core file and the code folder Completely dividing to 3 partes

02-02-2012, 03:38 PM
Are you sure its not your rewrite causing the problem?
I really have no intention of going through 1.5MB of your code to find a single /. You'll need to work out whether this issue is a PHP one or a rewrite one. Multiple sequential /'s within a URL (except the scheme) will not cause a failure. I thought your issue was actually creating the url, but right now it sure stinks of your rewrite.