how can I redirect some links in lowercase in .htaccess?
RedirectMatch 301 ^/folder/(.*?)\.php$ http://www.site.it/folder/(>($1)/artista.php
<)/artista.php
(>
($1) in lowercase
<) in lowercase
example:
from: /folder/ADAMS.php
to: /folder/adams/artista.php
:cry: :cry: :cry:
Convert Uppercase To Lowercase In Htaccess
Subject: Re: Convert Uppercase To Lowercase In Htaccess
Only using htaccess is a bit tough... or at least I don't know how to do that... you should ask Apache specialists.
In cases like this I personally use PHP code... I redirect all requests to a php file which then parse the address and redirect where I want to.
In cases like this I personally use PHP code... I redirect all requests to a php file which then parse the address and redirect where I want to.
Subject: Re: Convert Uppercase To Lowercase In Htaccess
Thanks MG, I found an other way.
I create this file that modify all files I want to redirect to.
I create this file that modify all files I want to redirect to.
$path = "./";
$dir_handle = @opendir($path) or die("Can't open $path");
while ($file = readdir($dir_handle))
if($file[0]!=".")
{
$fp = fopen($file, "w");
if(!$fp)
die ("Error");
fwrite($fp, '<? Header( "HTTP/1.1 301 Moved Permanently" ); Header( "Location: http://www.pugliabaila.it/discografie/" . strtolower(substr($_SERVER[\'PHP_SELF\'], 13, -4)) . "/artista.php" ); ?> ');
$fp = fclose($fp);
}
closedir($dir_handle);
$dir_handle = @opendir($path) or die("Can't open $path");
while ($file = readdir($dir_handle))
if($file[0]!=".")
{
$fp = fopen($file, "w");
if(!$fp)
die ("Error");
fwrite($fp, '<? Header( "HTTP/1.1 301 Moved Permanently" ); Header( "Location: http://www.pugliabaila.it/discografie/" . strtolower(substr($_SERVER[\'PHP_SELF\'], 13, -4)) . "/artista.php" ); ?> ');
$fp = fclose($fp);
}
closedir($dir_handle);
Subject: Re: Convert Uppercase To Lowercase In Htaccess
That was exactly what I was suggesting... PHP redirect. :)
Glad you solved.
Glad you solved.
Page 1 of 1
You cannot post new topicsYou cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events
This is a "Lo-Fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by Icy Phoenix based on phpBB
Generation Time: 0.4336s (PHP: 5% SQL: 95%)
SQL queries: 29 - Debug Off - GZIP Enabled