...

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



yosri algharawy
02-01-2012, 11:57 AM
hi,
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


'/'.$Article->id.'/'.

after


$Article->Category->url.

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

example:
http://sharemorearticles.info/misc//2/tweetattacks-professional-review-twitter-advertising.html

when i delet


'/'.

that before


$Article->id.'/'.

the url not work and give me the missage

page can't be found

Fou-Lu
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

Fou-Lu
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
no,
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

Fou-Lu
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
http://sharemorearticles.info/misc/2/tweetattacks-professional-review-twitter-advertising.html

but it works with two slashs

http://sharemorearticles.info/misc//2/tweetattacks-professional-review-twitter-advertising.html

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

Fou-Lu
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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum