[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

mod_rewrite and .htaccess

Posted on 2004-11-18
2
Medium Priority
?
191 Views
Last Modified: 2010-03-04
Hi,

can someone please help me with this regular expression to put in the .htaccess file,

I want all request on a site to be directed to the default page, for example these three:

http://www.mysite.com/abc
http://www.mysite.com/abc/somfile.html
http://www.mysite.com/abc/def/

should all be directed to:

http://www.mysite.com

Please help...

/Nick
0
Comment
Question by:Nick_72
2 Comments
 
LVL 5

Accepted Solution

by:
mrielf earned 2000 total points
ID: 12628384
You need everything starting with /abc to be redirected back to startpage?

Put this in your .htaccess

RewriteEngine On
RewriteRule ^/abc/* / [R]

This will redirect all url what you typed, but for example doesn't redirect http://www.mysite.com/abcdef/somesite.html
0
 
LVL 9

Author Comment

by:Nick_72
ID: 12630659
Actually, I have found out what I really wanted to do which what not what I asked for, so I'll accept your answer since it answers the question asked and then ask a new question.
Hopefully you'll take a look at that one too. :)

Thanks,

Nick
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
The title says it all. Writing any type of PHP Application or API code that provides high throughput, while under a heavy load, seems to be an arcane art form (Black Magic). This article aims to provide some general guidelines for producing this typ…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month17 days, 14 hours left to enroll

831 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