homepage Welcome to WebmasterWorld Guest from 54.226.21.57
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
Just switched to a new server.
none of my redirects work. Probably an easy fix.
acimag

5+ Year Member



 
Msg#: 4301904 posted 2:53 pm on Apr 21, 2011 (gmt 0)

Let me give the full scope hopefully I don't lose anyone.

We had a 5 year old webserver. So they told us we can upgrade to a much better server. So we migrated all the accounts to the new server(luckily we didn't switch the DNS's to the new account) we also switched from PHP4 to PHP5

So we took a couple of sites that rely on the htaccess and the database to pull dynamic pages.

In the Htaccess file have the line:
RewriteRule ^([^/]*)\.htm$ /?p=$1 [L]

but when we access the website after the dns propogated:

*****************************

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@babyloncomputerrepair[dot]com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.


--------------------------------------------------------------------------------

Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 mod_mono/2.6.3 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 mod_jk/1.2.30 PHP/5.2.17 mod_perl/2.0.4 Perl/v5.8.8 Server at www.babyloncomputerrepair.com Port 80
****************************

$$$$$$$$$$$$$$$$$$$$$ So then i went into the access file and commented out the line in the HTACCESS FILE

#RewriteRule ^([^/]*)\.htm$ /?p=$1 [L] the site loads.

but when i click a link and goto this page www.babyloncomputerrepair[dot]com/babylon_computer_repair.htm it gives this error

[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[

Not Found
The requested URL /babylon_computer_repair.htm was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.


--------------------------------------------------------------------------------

Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 mod_mono/2.6.3 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 mod_jk/1.2.30 PHP/5.2.17 mod_perl/2.0.4 Perl/v5.8.8 Server at www.babyloncomputerrepair.com Port 80
]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]

but if i access it
www.babyloncomputerrepair[dot]com/?p=babylon_computer_repair then it works.


Does anyone have an idea's?

 

g1smd

WebmasterWorld Senior Member g1smd us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4301904 posted 5:45 pm on Apr 21, 2011 (gmt 0)

Do you have
DirectoryIndex index.php or similar specified?

If not, add it.

Alternatively, try

RewriteRule ^([^/.]+)\.htm$ /index.php?p=$1 [L]

You'll also want + instead of * in your pattern otherwise a request for
www.example.com/.htm would be valid.
acimag

5+ Year Member



 
Msg#: 4301904 posted 7:21 pm on Apr 21, 2011 (gmt 0)

I tried specifying index.htm. I just added this. Here is a copy of my HTACCESS FILE.


# -MY HTACCESS FILE-

IndexIgnore .htaccess */.?* *~ *# */HEADER* */README* */_vti*
#DirectoryIndex index.htm
<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
#AuthName www.babyloncomputerrepair[dot]com
#AuthUserFile /home/balonc/public_html/_vti_pvt/service.pwd
#AuthGroupFile /home/balonc/public_html/_vti_pvt/service.grp






ErrorDocument 404 /oops.html
#RemoveHandler .html .htm .file .inc .php1 .js .css
#AddType application/x-httpd-php .php .htm .html .file .inc .php1 .js .css
RemoveHandler .html .htm .file .inc .txt .xml
AddType application/x-httpd-php .php .htm .html .file .inc .txt

RewriteEngine On


RewriteCond %{HTTP_HOST} ^babyloncomputerrepair[dot]com$ [NC]
RewriteRule ^(.*)$ [babyloncomputerrepair[dot]com...] [R=301,L]

#RewriteRule ^([^/]*)\.htm$ /?p=$1 [L]
#RewriteRule ^([^/.]+)\.htm$ /index.htm?p=$1 [L]



RewriteRule ^([^/]*)/([^/]*)\.htm$ /?p=$1&s=$2 [L]
RewriteRule ^([^/]*)/([^/]*)/([^/]*)\.htm$ /?p=$1&s=$2&ss=$3 [L]

SetEnvIf Remote_Addr ^74\.52\.45\.250$ getout
SetEnvIf Remote_Addr ^88\.191\.88\.79$ getout
SetEnvIf Remote_Addr ^89\.122\.29\.36$ getout
SetEnvIf Remote_Addr ^80\.57\.190\.67$ getout
SetEnvIf Remote_Addr ^89\.122\.29\.39$ getout
SetEnvIf Remote_Addr ^194\.186\.55\.209$ getout
SetEnvIf Remote_Addr ^62\.163\.15\.54$ getout
SetEnvIf Remote_Addr ^89\.122\.29\.127$ getout
SetEnvIf Remote_Addr ^89\.122\.29\.124$ getout
SetEnvIf Remote_Addr ^206\.161\.120\.9$ getout
SetEnvIf Remote_Addr ^38\.100\.41\.105$ getout
SetEnvIf Remote_Addr ^74\.52\.177\.210$ getout
SetEnvIf Remote_Addr ^89\.122\.29\.33$ getout
SetEnvIf Remote_Addr ^89\.122\.29\.31$ getout
SetEnvIf Remote_Addr ^89\.122\.29\.80$ getout
SetEnvIf Remote_Addr ^89\.123\.57\.222$ getout
SetEnvIf Remote_Addr ^66\.150\.224\.245$ getout
SetEnvIf Remote_Addr ^89\.122\.29\.32$ getout
SetEnvIf Remote_Addr ^89\.122\.29\.76$ getout
SetEnvIf Remote_Addr ^89\.122\.29\.35$ getout
SetEnvIf Remote_Addr ^89\.122\.29\.82$ getout
SetEnvIf Remote_Addr ^66\.90\.118\.101$ getout
SetEnvIf Remote_Addr ^80\.152\.218\.122$ getout
SetEnvIf Remote_Addr ^89\.122\.29\.61$ getout
SetEnvIf Remote_Addr ^89\.122\.29\.40$ getout
SetEnvIf Remote_Addr ^89\.122\.29\.79$ getout
SetEnvIf Remote_Addr ^93\.144\.167\.93$ getout
SetEnvIf Remote_Addr ^89\.122\.224\.52$ getout
SetEnvIf Remote_Addr ^89\.122\.29\.77$ getout
SetEnvIf Remote_Addr ^91\.193\.166\.178$ getout
SetEnvIf Remote_Addr ^67\.159\.45\.66$ getout
SetEnvIf Remote_Addr ^24\.6\.136\.64$ getout
SetEnvIf Remote_Addr ^89\.122\.29\.81$ getout
SetEnvIf Remote_Addr ^67\.19\.168\.162$ getout
SetEnvIf Remote_Addr ^60\.190\.240\.66$ getout
SetEnvIf Remote_Addr ^38\.100\.41\.113$ getout
SetEnvIf Remote_Addr ^64\.62\.142\.170$ getout
SetEnvIf Remote_Addr ^60\.190\.240\.73$ getout
SetEnvIf Remote_Addr ^74\.50\.105\.113$ getout
SetEnvIf Remote_Addr ^24\.132\.226\.94$ getout
SetEnvIf Remote_Addr ^38\.105\.83\.11$ getout
SetEnvIf Remote_Addr ^69\.84\.207\.147$ getout
SetEnvIf Remote_Addr ^66\.232\.97\.32$ getout
SetEnvIf Remote_Addr ^195\.5\.190\.91$ getout
SetEnvIf Remote_Addr ^38\.100\.41\.112$ getout
SetEnvIf Remote_Addr ^70\.85\.10\.66$ getout
SetEnvIf Remote_Addr ^60\.240\.249\.194$ getout
SetEnvIf Remote_Addr ^67\.228\.177\.87$ getout
SetEnvIf Remote_Addr ^207\.106\.29\.75$ getout
SetEnvIf Remote_Addr ^74\.55\.99\.66$ getout
SetEnvIf Remote_Addr ^38\.100\.41\.107$ getout
SetEnvIf Remote_Addr ^84\.242\.64\.107$ getout
SetEnvIf Remote_Addr ^85\.25\.55\.197$ getout
SetEnvIf Remote_Addr ^217\.174\.242\.76$ getout
SetEnvIf Remote_Addr ^85\.222\.12\.83$ getout
SetEnvIf Remote_Addr ^82\.177\.9\.202$ getout
SetEnvIf Remote_Addr ^203\.162\.2\.133$ getout

SetEnvIf Request_URI "^(/403./robots\.txt*\.jpg*\.gif*\.jpeg)$" allowsome
<Files *>
order deny,allow
deny from env=getout
allow from env=allowsome
</Files>


# ensure CHMOD settings for specified file types
# remember to never set CHMOD 777 unless you know what you are doing
# files requiring write access should use CHMOD 766 rather than 777
# keep specific file types private by setting their CHMOD to 400
# chmod .htaccess files 640
# chmod .htpasswd files 640



#bandwidth reducer
<ifModule mod_php4.c>
php_value zlib.output_compression 16386
</ifModule>

deny from 91.74.160.18
deny from 203.162.2.136
deny from 85.91.81.188
deny from 84.174.72.102
deny from 217.185.183.70
deny from 205.234.145.222

g1smd

WebmasterWorld Senior Member g1smd us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4301904 posted 7:29 pm on Apr 21, 2011 (gmt 0)

The * makes this code ambiguous:
RewriteRule ^([^/]*)/([^/]*)\.htm$ /?p=$1&s=$2 [L]
RewriteRule ^([^/]*)/([^/]*)/([^/]*)\.htm$ /?p=$1&s=$2&ss=$3 [L]


You will need this:
RewriteRule ^([^/.]+)\.htm$ /index.htm?p=$1 [L]
RewriteRule ^([^/]+)/([^/.]+)\.htm$ /index.php?p=$1&s=$2 [L]
RewriteRule ^([^/]+)/([^/]+)/([^/.]+)\.htm$ /index.php?p=$1&s=$2&ss=$3 [L]

All of the changes are there for a reason.

jdMorgan

WebmasterWorld Senior Member jdmorgan us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4301904 posted 6:15 pm on Apr 25, 2011 (gmt 0)

> migrated all the accounts to the new server

Due to differences in the server config file, you may need to add

Options +FollowSymLinks -MultiViews

to get your code working again.

You have two errors due to non-existent error documents. Fix these now to simplify your debugging. Either create the error document files as static html pages with no includes (no image, css, or script includes), or change the ErrorDocument directives to output short, fixed text strings. See the ErrorDocument directive documentation for details -- and heed well the warning about the effects of using a URL instead of a filepath for an ErrorDocument... Using a URL for an ErrorDocument is SEO-fatal.

Jim

acimag

5+ Year Member



 
Msg#: 4301904 posted 1:47 pm on Apr 26, 2011 (gmt 0)

Its wierd when i look at the error log it says

"htaccess directory not allowed here."

acimag

5+ Year Member



 
Msg#: 4301904 posted 1:53 pm on Apr 26, 2011 (gmt 0)

server config file - is that the "httpd.conf"

g1smd

WebmasterWorld Senior Member g1smd us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4301904 posted 11:01 pm on Apr 26, 2011 (gmt 0)

It could be httpd.conf or it could be the .htaccess file.

There are minor, but important, syntax differences depending on where the code is used.

acimag

5+ Year Member



 
Msg#: 4301904 posted 1:24 pm on May 9, 2011 (gmt 0)

I just want to tell everyone the issue we had is solved.

The new server had a newer version of apache so we just had to alter some htaccess

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved