Welcome! Log In Create A New Profile

Advanced

mod rewrite convert

Posted by dencow 
mod rewrite convert
May 27, 2012 02:51AM
Cara konversi mod rewrite ini gimana ya?

RewriteEngine On
RewriteCond %{REQUEST_URI} ^(.+)\~s$
RewriteRule ^(.*) stats.php?u=$1 [L]
RewriteCond %{REQUEST_URI} ^(.+)\~d$
RewriteRule ^(.*) delete_file.php?u=$1 [QSA,L]
RewriteCond %{REQUEST_URI} ^(.+)\~i$
RewriteRule ^(.*) share_file.php?u=$1 [QSA,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !\.html$
RewriteRule ^(.*) file_download.php?u=$1 [QSA,L]

RewriteRule ^(.*).html$ $1.php [L]
Re: mod rewrite convert
October 30, 2012 04:18AM
coba ini:

location / {
if ($request_uri ~ "^(.+)\~s$"){
rewrite ^/(.*) /stats.php?u=$1 break;
}
if ($request_uri ~ "^(.+)\~d$"){
rewrite ^/(.*) /delete_file.php?u=$1 break;
}
if ($request_uri ~ "^(.+)\~i$"){
rewrite ^/(.*) /share_file.php?u=$1 break;
}
if (!-e $request_filename){
rewrite ^/(.*) /file_download.php?u=$1 break;
}
rewrite ^/(.*).html$ /$1.php break;
}
Re: mod rewrite convert
September 03, 2013 07:57AM
Thanks for sharing a great post
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 125
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready