The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> How do I 301 redirect all pages in a folder?
thegreatpursuit
post Dec 20 2010, 10:00 PM
Post #1





Group: Members
Posts: 6
Joined: 7-August 10
Member No.: 12,452



I want to redirect

mysite.com/main/?p=1
mysite.com/main/?p=2
mysite.com/main/?p=3
mysite.com/main/?p=4
mysite.com/main/?p=5
etc etc

to

mysite.com

How can I do this with an htaccess file without having to manually redirect all of them?

Thanks,

Brandon
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Dec 20 2010, 10:51 PM
Post #2


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



IIRC you can do...

CODE
RedirectPermanent    /main/    http://mysite.com

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Dec 20 2010, 11:37 PM
Post #3


WDG Member
********

Group: Root Admin
Posts: 8,365
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



Failing that, look for the "Filesystem Reorganization" example in the Apache URL Rewriting Guide:
http://httpd.apache.org/docs/2.0/misc/rewriteguide.html#url
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 19th April 2024 - 06:14 PM