Welcome! Log In Create A New Profile

Advanced

Newbie, Luvin nginX but having problems with htaccess

Posted by solokron 
Newbie, Luvin nginX but having problems with htaccess
April 11, 2010 09:06PM
So I have nginx working in a cpanel environment and processing everything but PHP. PHP is then passed to Apache. MUCH faster! I am loving it so far! The problem I have is a website a client has htaccess mod rewrites for an .php files to display as .html for SEO reasoning. As nginx is not parsing .php it immediately posts a

404 Not Found
nginx/0.7.65

when the .html file which is really a redirect to a .php is hit. Besides not using a redirect and keeping the client's site as is, is there a way to correct this so the .php files are loaded even though that a .htm redirects??
Re: Newbie, Luvin nginX but having problems with htaccess
April 11, 2010 09:33PM
Here is a simplified htaccess file I am dealing with:

[code]
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain.com [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]
RewriteRule ^tag-search/([0-9a-zA-Z\_\-]*)\.htm([l]?)$ index.php?option=com_tagsearch&view=frontend&Itemid=313&tag_code=$1&%{QUERY_STRING} [L]
RewriteRule ^news/list/([0-9a-zA-Z\_\-]*)\.htm([l]?)$ index.php?option=com_conewsviewer&view=frontend&Itemid=195&mode=list&news_code=$1&%{QUERY_STRING} [L]

RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
RewriteRule ^(.*)$ index.php [F,L]

########## Begin - Joomla! core SEF Section
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$ [NC]
RewriteRule (.*) index.php
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
#
########## End - Joomla! core SEF Section


redirect 301 /shop/index.php?l=product_detail&p=66 http://www.domain.com/stuff/county-states.html
redirect 301 /shop/index.php?l=product_detail&p=45 http://www.domain.com/stuff/apparel/hats/big-beanie.html

redirect 301 /2009/06/sham-shibby http://www.domain.com/videos/0-shibby-105.html
redirect 301 /radio/#episodes http://www.domain.com/crazy-on-radio.html

redirect 301 /2009/12/john%e2%80%99-knitting-shibby-thing-winner http://www.domain.com/news/view/john_knitting_shibby_thing_winner-2.html

redirect 301 /images/f32j/andy.jpg http://www.domain.com/f32j/andy.html

redirect 301 /category/entries http://www.domain.com/news.html

ErrorDocument 404 http://www.domain.com/404.html
ErrorDocument 403 http://www.domain.com/404.html


[/code]
Re: Newbie, Luvin nginX but having problems with htaccess
April 11, 2010 09:53PM
Is there a program out there that will give you updated lines for nginx? One would think there would be a web script or something to ease the pain!
Re: Newbie, Luvin nginX but having problems with htaccess
April 11, 2010 10:00PM
I did try http://www.anilcetin.com/convert-apache-htaccess-to-nginx/ but it left me with nothing but internal server errors.
Re: Newbie, Luvin nginX but having problems with htaccess
April 12, 2010 01:21PM
Can anyone help me out with this?
Re: Newbie, Luvin nginX but having problems with htaccess
April 15, 2010 02:37AM
I figured out the issue.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 241
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready