saiyan
1
Hello everybody here in NGINX
Hello Igor, and others.
I need a help regarding rewrite problem
Source:
RewriteEngine on
Some hostings require RewriteBase to be uncommented
Example:
So “RewriteBase” should be:
RewriteBase /store/cart
#RewriteBase /
#RewriteCond %{REQUEST_FILENAME} !.(png|gif|ico|swf|jpe?g|js|css)$
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule . index.php?sef_rewrite=1
#RewriteCond %{REQUEST_FILENAME} ./catalog/.
#RewriteCond %{REQUEST_FILENAME} -d
#RewriteCond %{REQUEST_FILENAME}/index.html !-f
#RewriteRule . index.php?sef_rewrite=1
i try this one:
location / {
if ($request_filename ~ “.html$”) {
rewrite ^/(.*)/t-([0-9]+).html$ /index.php?sef_rewrite=1
permanent;
}
}
but it doesnt work, -__-
please guide me, thank you very much.
Posted at Nginx Forum:
saiyan
2
RewriteRule /catalog/(.) /catalog/$1
RewriteRule /lib/(.) /lib/$1
RewriteRule /skins/(.) /skins/$1
RewriteRule /payments/(.) /payments/$1
RewriteRule /images/(.) /images/$1
RewriteRule /index.php(.) /index.php$1
RewriteRule /admin.php(.) /admin.php$1
RewriteRule ^(.)$ /index.php?sef_rewrite=1
Posted at Nginx Forum:
saiyan
3
RewriteRule /catalog/(.) /catalog/$1
RewriteRule /lib/(.) /lib/$1
RewriteRule /skins/(.) /skins/$1
RewriteRule /payments/(.) /payments/$1
RewriteRule /images/(.) /images/$1
RewriteRule /index.php(.) /index.php$1
RewriteRule /admin.php(.*) /admin.php$1
RewriteRule ^(.*)$ /index.php?sef_rewrite=1
Do you realize that everything except this one rule is a NO-OP?
Posted at Nginx Forum:
saiyan
4
On Sat, Oct 03, 2009 at 09:36:20PM -0400, saiyan wrote:
Example:
#RewriteCond %{REQUEST_FILENAME} -d
}
but it doesnt work, -__-
please guide me, thank you very much.
location ~ .(png|gif|ico|swf|jpe?g|js|css)$ {
try_files $uri $uri/ /index.php?sef_rewrite=1
}
location ~ /catalog/ {
try_files $uri/index.html /index.php?sef_rewrite=1
}
saiyan
5
On Sun, Oct 04, 2009 at 02:13:05AM -0400, anomalizer wrote:
Do you realize that everything except this one rule is a NO-OP?
They are very heavy noops.
saiyan
6
On Sat, Oct 03, 2009 at 09:57:52PM -0400, saiyan wrote:
RewriteRule /catalog/(.) /catalog/$1
RewriteRule /lib/(.) /lib/$1
RewriteRule /skins/(.) /skins/$1
RewriteRule /payments/(.) /payments/$1
RewriteRule /images/(.) /images/$1
RewriteRule /index.php(.) /index.php$1
RewriteRule /admin.php(.) /admin.php$1
RewriteRule ^(.)$ /index.php?sef_rewrite=1
location / {
rewrite ^ /index.php?sef_rewrite=1;
}
location /catalog/ {
fastcgi_pass ...
}
location /lib/ {
fastcgi_pass ...
}
location /skins/ {
fastcgi_pass ...
}
location /payments/ {
fastcgi_pass ...
}
location /images/ {
fastcgi_pass ...
}
location /index.php {
fastcgi_pass ...
}
location /admin.php {
fastcgi_pass ...
}