Solved

Apache .htaccess question

Posted on 2010-08-28
5
408 Views
Last Modified: 2012-05-10
Hi,

I am getting Page not found after using .htaccess on my site.

I have installed a commercial on my servint.com VPS server.

The script server requirement is support of .htaccess files.

I have uploaded the  .htaccess file to the right place (main folder), code is attached here.

For any reason urls are not redirecting properly and returning page not found. See it live here:
http://www.softnetweb.com/

I opened a ticket on server support and they say:
".htaccess files are already executable on your server. They will function as normal. The problem seems to be with the coding itself."

Script developer support said that may be the AddHandler in the server not enabled.

on the script demo site the SEO friendly urls works perfect.

Why not on my server?
Help!


AddHandler server-parsed .php
<Files ~ "^[^.]+$">
SetHandler application/x-httpd-php
</Files>
AddHandler application/x-httpd-php .php

Open in new window

0
Comment
Question by:Fernanditos
  • 2
  • 2
5 Comments
 
LVL 7

Expert Comment

by:mcuk_storm
ID: 33550202
From the code you have posted it is telling the server to process everything without a file extension as PHP, the problem seems to be that on the site you have given the seo urls i.e. http://www.softnetweb.com/article/seo-articles-the-best-way-to-generate-traffic-to-your-site-79-1.html have .html at the end of them, so they wouldn't match that rule anyway.
0
 

Author Comment

by:Fernanditos
ID: 33550236
hmm, I dont think this is the reason, they are using the same .htaccess on the demo site and files has also .html extensions. It seems to be something on the apache configuration. but, what could be?
0
 
LVL 7

Expert Comment

by:mcuk_storm
ID: 33550281
Well there are no rewrite rules in what you posted so apache will literally be looking for the file http://www.softnetweb.com/article/seo-articles-the-best-way-to-generate-traffic-to-your-site-79-1.html which i'm guessing doesn't exist as i would expect it to extract the info it needs from the url using mod_rewrite, or at least redirect all traffic to a single script to then work out what page to serve based on the SCRIPT_URL/REQUEST_URI. Do you have any rewrite rules in there at the moment that come with the main CMS?
0
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 33552371
Can you describe what you're trying to achieve here?  Just in plain language, not anything technical.  Thanks, ~Ray
0
 

Accepted Solution

by:
Fernanditos earned 0 total points
ID: 33552477
Here the dynamic and seo friendly URLs:

http://www.softnetweb.com/articles.php?art_id=83&start=1
http://www.softnetweb.com/article/how-to-create-a-portfolio-83-1.html

Redirection was not working with the .htaccess from my first post.

The problem has been fixed by modifying the .htaccess code. I attach the right code here, not it works pefect. thank you.

AddHandler server-parsed .php
<Files ~ "^[^\.]+$">
SetHandler application/x-httpd-php5
</Files>
AddHandler application/x-httpd-php5 .php

Open in new window

0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question