Solved

Help with a .htaccess rewrite problem

Posted on 2006-10-20
2
186 Views
Last Modified: 2010-03-04
Hi

I'm a complete newbie when it comes to .htaccess - I know how to copy and paste into it but that's all!

What I'm after...is a rule that will automatically rewrite

www.domain.com/items/items/filename.php?stuff=3

to

www.domain.com/items/filename.php?stuff=3

Long live google constantly crawling dead files!

Thanks
0
Comment
Question by:su-n
[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 16

Accepted Solution

by:
HackneyCab earned 125 total points
ID: 17785591
Try this in the .htaccess file for the top-level directory:

RewriteEngine On
RewriteRule ^items/items/([a-z]+)\.php$ http://www.domain.com/items/$1.php [R=301]

That should cause requests for items/items to be redirected (causing the browser to change address) to the items/ folder. It will match any filename that consists of only alphabetic characters. If you want a more permissive pattern, it'll have to be adjusted to suit. The query string should be passed intact by the redirect, but let me know if this is not the case.
0
 
LVL 1

Author Comment

by:su-n
ID: 17787001
Thanks, Cabby - appreciated
0

Featured Post

Manage your data center from practically anywhere

The KN8164V features HD resolution of 1920 x 1200, FIPS 140-2 with level 1 security standards and virtual media transmissions at twice the speed. Built for reliability, the KN series provides local console and remote over IP access, ensuring 24/7 availability to all servers.

Question has a verified solution.

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

In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Suggested Courses

617 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