Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3453570
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T09:23:22+00:00 2026-05-18T09:23:22+00:00

I was using something like this… RewriteRule here/(.*) http://www.there.com/$1 [R=301,L] but couldn’t get it

  • 0

I was using something like this…

RewriteRule here/(.*) http://www.there.com/$1 [R=301,L] 

but couldn’t get it to work

So I used this…

redirect 301 /here http://www.there.com 

and it worked fine.

Can someone explain the difference?
Do you need both?

Also… how do I exclude paths from the redirect?

Like…
redirect 301 all…

redirect 301 /here http://www.there.com 

but

/here/stayhere.html

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T09:23:23+00:00Added an answer on May 18, 2026 at 9:23 am

    RewriteRule is handled by Apache’s mod_rewrite, while Redirect is handled by mod_alias. No, you don’t need both.

    Your RewriteRule (which uses regex) will not match /here (but will match such paths as /here/foo.html) because it is looking for a slash immediately after. You can make that optional by using a question mark:

    RewriteRule ^here(/?.*) http://www.there.com$1 [R=301,L]
    

    Now that will have the same effect as your Redirect. RewriteCond can be added to exclude certain paths:

    RewriteCond $0 !/here/stayhere\.html
    

    Note that some servers do not have mod_rewrite turned on by default. If adding RewriteEngine on to your configuration does not fix the problem and you cannot switch mod_rewrite on, at least mod_alias provides the RedirectMatch directive, which may be good enough:

    RedirectMatch 301 ^/here(?!/stayhere\.html)(/?.*) http://www.there.com$1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using something like this mysite.com/out.php?url=outurl.com I'm just using a simple redirect, but I'm
Using something like this: try: # Something... except Exception as excep: logger = logging.getLogger(component)
So, I'm trying to consume a webservice using something like this: $client = new
Writing something like this using the loki library , typedef Functor<void> BitButtonPushHandler; throws a
If I do something like this: using (SqlCommand cmd = new SqlCommand(SELECT * FROM
I'd like to do something like this to tick a checkbox using jQuery :
does anyone know if you can do something like this using the (N)Hibernate criteria
I'm using something like this in my template <select multiple=multiple name=services id=services size=5> {%
I'm using something like this to browse for a file in AIR. I can
I toggle a div using something like this - <input type=radio name=myRadio value=myDiv_1 />MyDiv

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.