Solved

Need help with simple RewriteRule

Posted on 2008-10-28
2
235 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
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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

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

Suggested Solutions

If you are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATE…
Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

911 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now