Advertisement

05.01.2008 at 02:50AM PDT, ID: 23368001
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.0

.htaccess Mod Rewrite issues for a dynamic site

Asked by socross in Apache Web Server, PHP Scripting Language, Web Servers

Tags:

Hi

I am having some issues with some mod rewrite code and need to find a solution to achieve the following.
I have attached the existing code that i am using.

1
I have the standard pages of the site (home, about-us, service, news, contact, search accessibility, privacy-policy, page-not-found) Which have been rewritten to the correct files /site/file.php

2
I then have a dynamic page (machine.php) which can take up to three $_get vars so it can be passed /1/, /1/2/ or /1/2/3/ vars

3
I then have the custom error pages which redirect to 401, 403 and 404 (so a mistake like /home-t/ would redirect to /page-not-found/



The issue is that /home-t/ which should go to 404 is going to machine.php

I may be missing a trick here, as im very new to mod rewrite, can anyone offer some advice, and and tips on how i could improve my code!

--s--



Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
Options +FollowSymLinks
RewriteEngine On
 
RewriteCond %{REQUEST_URI} !^/images$ [NC]
 
RewriteRule     ^$  /site/home.php
 
RewriteRule     ^([^/.]+)/$  /site/machine.php?maincat=$1
RewriteRule     ^([^/.]+)/([^/.]+)/$  /site/machine.php?maincat=$1&manucat=$2
RewriteRule     ^([^/.]+)/([^/.]+)/([^/.]+)/$  /site/machine.php?maincat=$1&manucat=$2&machine=$3
 
RewriteRule     ^home/$  /site/home.php
RewriteRule     ^about-us/$  /site/about-us.php
RewriteRule     ^service/$  /site/service.php
RewriteRule     ^news/$  /site/news.php
RewriteRule     ^contact/$  /site/contact.php
RewriteRule     ^search/$  /site/search.php
RewriteRule     ^accessibility/$  /site/contact.php
RewriteRule     ^privacy-policy/$  /site/search.php
 
RewriteRule     ^technical-difficulties/$  /site/tech.php
RewriteRule     ^unauthorised/$  /site/tech.php?page=401
RewriteRule     ^forbidden/$  /site/tech.php?page=403
RewriteRule     ^page-not-found/$  /site/tech.php?page=404
 
 
ErrorDocument 401 /unauthorised/
ErrorDocument 403 /forbidden/
ErrorDocument 404 /page-not-found/
 
 
[+][-]05.01.2008 at 10:07AM PDT, ID: 21480505

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.13.2008 at 02:37AM PDT, ID: 21553398

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Apache Web Server, PHP Scripting Language, Web Servers
Tags: apache htaccess
Sign Up Now!
Solution Provided By: MrEne
Participating Experts: 2
Solution Grade: A
 
 
[+][-]05.13.2008 at 02:44AM PDT, ID: 21553438

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-42 / EE_QW_2_20070628