mesela
.com/pages/İletişim.html olan sayfa
.com/pages/%DDleti%FEim.html olarak görünüyor ben bunn
.com/pages/iletisim.html olarak görünmesini istiyorum
scripti biraz daha inceleyince bununla ilgili bi kaç dosya daha buldum onlarıda ekliyorum
htaccess
Options -MultiViews -Indexes +FollowSymlinks
RewriteEngine On
<IfModule mod_security.c>
# Turn off mod_security filtering.
SecFilterEngine Off
# The below probably isn't needed, but better safe than sorry.
SecFilterScanPOST Off
</IfModule>
<IfModule !mod_php4.c>
<IfModule !mod_php5.c>
# PHP is in CGI Mode, so we need a different mod_rewrite
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !categories\.php
RewriteRule ^categories(.*) categories.php?$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !articles\.php
RewriteRule ^articles(.*)$ articles.php?$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !pages\.php
RewriteRule ^pages(.*)$ pages.php?$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !blogs\.php
RewriteRule ^blogs(.*)$ blogs.php?$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !search.php
RewriteRule ^search(.*)$ search\.php?$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !authors.php
RewriteRule ^authors(.*)$ authors\.php?a=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !articlerss.php
RewriteRule ^articlerss(.*)$ articlerss\.php?$1 [L]
RewriteCond %{REQUEST_URI} !news.php
RewriteCond %{REQUEST_URI} !newsrss.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^news(.*)$ news.php?$1 [L]
</IfModule>
<IfModule mod_php5.c>
# Using PHP 5 in module mode
RewriteCond %{REQUEST_URI} categories.*
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^categories(.*)$ categories.php?$1 [T=application/x-httpd-php,L]
RewriteCond %{REQUEST_URI} articles.*
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^articles(.*)$ articles.php?$1 [T=application/x-httpd-php,L]
RewriteCond %{REQUEST_URI} pages.*
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^pages(.*)$ pages.php?$1 [T=application/x-httpd-php,L]
RewriteCond %{REQUEST_URI} blogs.*
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^blogs(.*)$ blogs.php?$1 [T=application/x-httpd-php,L]
RewriteCond %{REQUEST_URI} search.*
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^search(.*)$ search.php?$1 [T=application/x-httpd-php,L]
RewriteCond %{REQUEST_URI} authors.*
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^authors(.*)$ authors.php?a=$1 [T=application/x-httpd-php,L]
RewriteCond %{REQUEST_URI} articlerss.*
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^articlerss(.*)$ articlerss.php?$1 [T=application/x-httpd-php,L]
RewriteCond %{REQUEST_URI} news.*
RewriteCond %{REQUEST_URI} !newsrss
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^news(.*)$ news.php?$1 [T=application/x-httpd-php,L]
</IfModule>
</IfModule>
<IfModule mod_php4.c>
# PHP 4 in module mode
RewriteCond %{REQUEST_URI} categories.*
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^categories(.*)$ categories.php?$1 [T=application/x-httpd-php,L]
RewriteCond %{REQUEST_URI} articles.*
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^articles(.*)$ articles.php?$1 [T=application/x-httpd-php,L]
RewriteCond %{REQUEST_URI} pages.*
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^pages(.*)$ pages.php?$1 [T=application/x-httpd-php,L]
RewriteCond %{REQUEST_URI} blogs.*
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^blogs(.*)$ blogs.php?$1 [T=application/x-httpd-php,L]
RewriteCond %{REQUEST_URI} search.*
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^search(.*)$ search.php?$1 [T=application/x-httpd-php,L]
RewriteCond %{REQUEST_URI} authors.*
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^authors(.*)$ authors.php?a=$1 [T=application/x-httpd-php,L]
RewriteCond %{REQUEST_URI} articlerss.*
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^articlerss(.*)$ articlerss.php?$1 [T=application/x-httpd-php,L]
RewriteCond %{REQUEST_URI} news.*
RewriteCond %{REQUEST_URI} !newsrss
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^news(.*)$ news.php?$1 [T=application/x-httpd-php,L]
</IfModule>functions.compat.php<?php
/**
* get_headers
*
* get_headers() is included in php5 but not php4. So lets make our own
* if it doesn't exist
*/
if(!function_exists('get_headers')){
function get_headers($url ) {
$url_info=parse_url($url);
if (isset($url_info['scheme']) && $url_info['scheme'] == 'https') {
$port = 443;
@$fp=fsockopen('ssl://'.$url_info['host'], $port, $errno, $errstr, 10);
} else {
$port = isset($url_info['port']) ? $url_info['port'] : 80;
@$fp=fsockopen($url_info['host'], $port, $errno, $errstr, 10);
}
if($fp) {
stream_set_timeout($fp, 10);
$head = "HEAD ".@$url_info['path']."?".@$url_info['query'];
$head .= " HTTP/1.0\r\nHost: ".@$url_info['host']."\r\n\r\n";
fputs($fp, $head);
while(!feof($fp)) {
if($header=trim(fgets($fp, 1024))) {
$sc_pos = strpos( $header, ':' );
if( $sc_pos === false ) {
$headers['status'] = $header;
} else {
$label = substr( $header, 0, $sc_pos );
$value = substr( $header, $sc_pos+1 );
$headers[strtolower($label)] = trim($value);
}
}
}
return $headers;
}
else {
return false;
}
}
}
if (!function_exists("stripos")) {
function stripos($str,$needle,$offset=0)
{
return strpos(strtolower($str),strtolower($needle),$offset);
}
}
if(!function_exists('html_entity_decode')){
function html_entity_decode($string) {
// replace numeric entities
$string = preg_replace('~&#x([0-9a-f]+);~ei', 'chr(hexdec("\\1"))', $string);
$string = preg_replace('~&#([0-9]+);~e', 'chr(\\1)', $string);
// replace literal entities
$trans_tbl = get_html_translation_table(HTML_ENTITIES);
$trans_tbl = array_flip($trans_tbl);
return strtr($string, $trans_tbl);
}
}
/**
* Replace str_ireplace()
*
* @category PHP
* @package PHP_Compat
* @link http://php.net/function.str_ireplace
* @author Aidan Lister <aidan@php.net>
* @version $Revision: 1.2 $
* @since PHP 5
* @require PHP 4.0.0 (user_error)
* @note count not by returned by reference, to enable
* change '$count = null' to '&$count'
*/
if (!function_exists('str_ireplace')) {
function str_ireplace($search, $replace, $subject, $count = null)
{
// Sanity check
if (is_string($search) && is_array($replace)) {
user_error('Array to string conversion', E_USER_NOTICE);
$replace = (string) $replace;
}
// If search isn't an array, make it one
if (!is_array($search)) {
$search = array ($search);
}
$search = array_values($search);
// If replace isn't an array, make it one, and pad it to the length of search
if (!is_array($replace)) {
$replace_string = $replace;
$replace = array ();
for ($i = 0, $c = count($search); $i < $c; $i++) {
$replace[$i] = $replace_string;
}
}
$replace = array_values($replace);
// Check the replace array is padded to the correct length
$length_replace = count($replace);
$length_search = count($search);
if ($length_replace < $length_search) {
for ($i = $length_replace; $i < $length_search; $i++) {
$replace[$i] = '';
}
}
// If subject is not an array, make it one
$was_array = false;
if (!is_array($subject)) {
$was_array = true;
$subject = array ($subject);
}
// Loop through each subject
$count = 0;
foreach ($subject as $subject_key => $subject_value) {
// Loop through each search
foreach ($search as $search_key => $search_value) {
// Split the array into segments, in between each part is our search
$segments = explode(strtolower($search_value), strtolower($subject_value));
// The number of replacements done is the number of segments minus the first
$count += count($segments) - 1;
$pos = 0;
// Loop through each segment
foreach ($segments as $segment_key => $segment_value) {
// Replace the lowercase segments with the upper case versions
$segments[$segment_key] = substr($subject_value, $pos, strlen($segment_value));
// Increase the position relative to the initial string
$pos += strlen($segment_value) + strlen($search_value);
}
// Put our original string back together
$subject_value = implode($replace[$search_key], $segments);
}
$result[$subject_key] = $subject_value;
}
// Check if subject was initially a string and return it as a string
if ($was_array === true) {
return $result[0];
}
// Otherwise, just return the array
return $result;
}
}
if (!defined('FILE_USE_INCLUDE_PATH')) {
define('FILE_USE_INCLUDE_PATH', 1);
}
if (!defined('LOCK_EX')) {
define('LOCK_EX', 2);
}
if (!defined('FILE_APPEND')) {
define('FILE_APPEND', 8);
}
/**
* Replace file_put_contents()
*
* @category PHP
* @package PHP_Compat
* @license LGPL - http://www.gnu.org/licenses/lgpl.html
* @copyright 2004-2007 Aidan Lister <aidan@php.net>, Arpad Ray <arpad@php.net>
* @link http://php.net/function.file_put_contents
* @author Aidan Lister <aidan@php.net>
* @version $Revision: 1.2 $
* @internal resource_context is not supported
* @since PHP 5
* @require PHP 4.0.0 (user_error)
*/
function php_compat_file_put_contents($filename, $content, $flags = null, $resource_context = null)
{
// If $content is an array, convert it to a string
if (is_array($content)) {
$content = implode('', $content);
}
// If we don't have a string, throw an error
if (!is_scalar($content)) {
user_error('file_put_contents() The 2nd parameter should be either a string or an array', E_USER_WARNING);
return false;
}
// Get the length of data to write
$length = strlen($content);
// Check what mode we are using
$mode = ($flags & FILE_APPEND) ?
'a' :
'wb';
// Check if we're using the include path
$use_inc_path = ($flags & FILE_USE_INCLUDE_PATH) ?
true :
false;
// Open the file for writing
if (($fh = @fopen($filename, $mode, $use_inc_path)) === false) {
user_error('file_put_contents() failed to open stream: Permission denied', E_USER_WARNING);
return false;
}
// Attempt to get an exclusive lock
$use_lock = ($flags & LOCK_EX) ? true : false ;
if ($use_lock === true) {
if (!flock($fh, LOCK_EX)) {
return false;
}
}
// Write to the file
$bytes = 0;
if (($bytes = @fwrite($fh, $content)) === false) {
$errormsg = sprintf('file_put_contents() Failed to write %d bytes to %s',
$length,
$filename);
user_error($errormsg, E_USER_WARNING);
return false;
}
// Close the handle
@fclose($fh);
// Check all the data was written
if ($bytes != $length) {
$errormsg = sprintf('file_put_contents() Only %d of %d bytes written, possibly out of free disk space.',
$bytes,
$length);
user_error($errormsg, E_USER_WARNING);
return false;
}
// Return length
return $bytes;
}
// Define
if (!function_exists('file_put_contents')) {
function file_put_contents($filename, $content, $flags = null, $resource_context = null)
{
return php_compat_file_put_contents($filename, $content, $flags, $resource_context);
}
}
define('PHP_COMPAT_FILE_GET_CONTENTS_MAX_REDIRECTS', 5);
/**
* Replace file_get_contents()
*
* @category PHP
* @package PHP_Compat
* @license LGPL - http://www.gnu.org/licenses/lgpl.html
* @copyright 2004-2007 Aidan Lister <aidan@php.net>, Arpad Ray <arpad@php.net>
* @link http://php.net/function.file_get_contents
* @author Aidan Lister <aidan@php.net>
* @author Arpad Ray <arpad@php.net>
* @version $Revision: 1.2 $
* @internal resource_context is only supported for PHP 4.3.0+ (stream_context_get_options)
* @since PHP 5
* @require PHP 4.0.0 (user_error)
*/
function php_compat_file_get_contents($filename, $incpath = false, $resource_context = null)
{
if (is_resource($resource_context) && function_exists('stream_context_get_options')) {
$opts = stream_context_get_options($resource_context);
}
$colon_pos = strpos($filename, '://');
$wrapper = $colon_pos === false ? 'file' : substr($filename, 0, $colon_pos);
$opts = (empty($opts) || empty($opts[$wrapper])) ? array() : $opts[$wrapper];
switch ($wrapper) {
case 'http':
$max_redirects = (isset($opts[$wrapper]['max_redirects'])
? $opts[$proto]['max_redirects']
: PHP_COMPAT_FILE_GET_CONTENTS_MAX_REDIRECTS);
for ($i = 0; $i < $max_redirects; $i++) {
$contents = php_compat_http_get_contents_helper($filename, $opts);
if (is_array($contents)) {
// redirected
$filename = rtrim($contents[1]);
$contents = '';
continue;
}
return $contents;
}
user_error('redirect limit exceeded', E_USER_WARNING);
return;
case 'ftp':
case 'https':
case 'ftps':
case 'socket':
// tbc
}
if (false === $fh = fopen($filename, 'rb', $incpath)) {
user_error('failed to open stream: No such file or directory',
E_USER_WARNING);
return false;
}
clearstatcache();
if ($fsize = @filesize($filename)) {
$data = fread($fh, $fsize);
} else {
$data = '';
while (!feof($fh)) {
$data .= fread($fh, 8192);
}
}
fclose($fh);
return $data;
}
/**
* Performs HTTP requests
*
* @param string $filename
* the full path to request
* @param array $opts
* an array of stream context options
* @return mixed
* either the contents of the requested path (as a string),
* or an array where $array[1] is the path redirected to.
*/
function php_compat_http_get_contents_helper($filename, $opts)
{
$path = parse_url($filename);
if (!isset($path['host'])) {
return '';
}
$fp = fsockopen($path['host'], 80, $errno, $errstr, 4);
if (!$fp) {
return '';
}
if (!isset($path['path'])) {
$path['path'] = '/';
}
$headers = array(
'Host' => $path['host'],
'Conection' => 'close'
);
// enforce some options (proxy isn't supported)
$opts_defaults = array(
'method' => 'GET',
'header' => null,
'user_agent' => ini_get('user_agent'),
'content' => null,
'request_fulluri' => false
);
foreach ($opts_defaults as $key => $value) {
if (!isset($opts[$key])) {
$opts[$key] = $value;
}
}
$opts['path'] = $opts['request_fulluri'] ? $filename : $path['path'];
// build request
$request = $opts['method'] . ' ' . $opts['path'] . " HTTP/1.0\r\n";
// build headers
if (isset($opts['header'])) {
$optheaders = explode("\r\n", $opts['header']);
for ($i = count($optheaders); $i--;) {
$sep_pos = strpos($optheaders[$i], ': ');
$headers[substr($optheaders[$i], 0, $sep_pos)] = substr($optheaders[$i], $sep_pos + 2);
}
}
foreach ($headers as $key => $value) {
$request .= "$key: $value\r\n";
}
$request .= "\r\n" . $opts['content'];
// make request
fputs($fp, $request);
$response = '';
while (!feof($fp)) {
$response .= fgets($fp, 8192);
}
fclose($fp);
$content_pos = strpos($response, "\r\n\r\n");
// recurse for redirects
if (preg_match('/^Location: (.*)$/mi', $response, $matches)) {
return $matches;
}
return ($content_pos != -1 ? substr($response, $content_pos + 4) : $response);
}
function php_compat_ftp_get_contents_helper($filename, $opts)
{
}
if (!function_exists('file_get_contents')) {
function file_get_contents($filename, $incpath = false, $resource_context = null)
{
return php_compat_file_get_contents($filename, $incpath, $resource_context);
}
}
?>class.helper.php dosyasındada bununla ilgili olduğunu düşündüğüm 2 bölüm var<?php
/**
* AL_Helper
*
* Miscellaneous but common functions used within ArticleLive. Other non-ArticleLive
* specific functions are located in the general.php file.
*
* @name AL_HELPER
*
*/
class AL_Helper {
/**
* AL_Helper::_MakeURLSafe()
*
* Converts ugly urls to clean readable urls
*
* @name _MakeURLSafe()
* @version 1.00
* @param string $Val url to encode
* @return string
*
*/
function _MakeURLSafe($Val) {
$val = str_replace("-", "%5F", $Val);
$val = str_replace("-", "_", $val);
$val = str_replace("/", "{47}", $val);
$val = urlencode($val);
return $val;
}
/**
* AL_Helper::_MakeURLNormal()
*
* Reverses _MakeURLSafe()
*
* @name _MakeURLNormal
* @author Mitchell Harper <mitch@interspire.com>
* @version 1.00
* @param string $Val url to decode
*
*/
function _MakeURLNormal($Val) {
$val = urldecode($Val);
$val = str_replace("{47}", "/", $val);
$val = str_replace("-", " ", $val);
$val = str_replace("%5F", "_", $val);
return $val;
}diğer bölüm /**
* AL_Helper::TruncateLink()
*
* Truncates a link URL if it is too long. Used from within hyperlinkUrls().
*
* @name truncateLink()
* @param string $url the url to link to
* @param integer $mode 0 = display full url, 11+ = number of characters to truncate after
* @param string $trunc_before what to display before truncation
* @param string $trunc_after what to display after truncation
*
*/
function TruncateLink($url, $mode = '0', $trunc_before = '', $trunc_after =
'...') {
if (1 == $mode) {
$url = preg_replace("/(([a-z]+?):\\/\\/[A-Za-z0-9\-\.]+).*/i", "$1", $url);
$url = $trunc_before . preg_replace("/([A-Za-z0-9\-\.]+\.(com|org|net|gov|edu|us|info|biz|ws|name|tv)).*/i", "$1", $url) . $trunc_after;
} elseif (($mode > 10) && (strlen($url) > $mode)) {
$url = $trunc_before . substr($url, 0, $mode) . $trunc_after;
}
return $url;
}sanırım lazım olan herşey burda şimdi ben bunu nasıl yapabilirim
ilginç $val yapınca çalışması lazım halbuki