Solved

Need help with simple RewriteRule

Posted on 2008-10-28
2
238 Views
Last Modified: 2012-05-05
I'm trying to redirect all requests to www.mysite.com/fdc to www.mysite.com/products/fdc

The rewrite stuff from my .htaccess file is posted below.

I don't understand why the fdc RewriteRule (line 5 below) isn't working.  But, it only directs me to my 404 page.

Any ideas on how to get this working?  Also, how to make it case insensitive?   That way it'll direct from www.mysite.com/FDC as well.

Thanks for your help!!


CheckSpelling off
ErrorDocument 404 /404.php
RewriteEngine on
 
RewriteRule ^fdc$ /products/fdc/ #why isn't this working????
 
 
RewriteCond %{REQUEST_URI} !(\.[^./]+)$
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*) /$1.php [L]

Open in new window

0
Comment
Question by:light_bulb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 27

Accepted Solution

by:
caterham_www earned 500 total points
ID: 22821525
May be missing R-Flag? (NC = no case)

You may speed-up your last rule, the rule-pattern is being processed before conditions are applied.
CheckSpelling off
ErrorDocument 404 /404.php
RewriteEngine on
 
RewriteRule ^fdc$ /products/fdc/ [R=301,L,NC]
 
 
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule !(\.[^./]+)$ %{REQUEST_URI}.php [L]

Open in new window

0
 
LVL 3

Author Closing Comment

by:light_bulb
ID: 31510708
Perfect solution!

Thanks for the help.
0

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

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

Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…
Suggested Courses

710 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