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 8566619
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:41:45+00:00 2026-06-11T17:41:45+00:00

In .htaccess, how do you 301-redirect dynamic pages? For example, what if I wanted

  • 0

In .htaccess, how do you 301-redirect dynamic pages?

For example, what if I wanted a rule that made www.domain.com/SomeFolder/theThing redirect to www.domain.com/theThing?

I just want to remove the /folder and keep everything else. I already tried but no success.

EDIT:

I’m going to try be clearer. I have:

  1. http://www.domain.com/SomeFolder/theThing
  2. http://www.domain.com/SomeFolder/AnotherThing
  3. http://www.domain.com/SomeFolder/AndOneMoreThing
  4. ..and etc etc.

I want to remove this SOMEFOLDER because all those links were moved to index. But there’s a lot of them and I was thinking about doing it automatically using dynamic redirect 301.

  • 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-06-11T17:41:46+00:00Added an answer on June 11, 2026 at 5:41 pm

    This is how you can do it.

    Using php:

    <?
     Header( "HTTP/1.1 301 Moved Permanently" );
     Header( "Location: http://www.new-url.com" );
    ?>
    

    Using htaccess:

    Create a .htaccess file with the below code, it will ensure that all your directories and pages of your old domain will get correctly redirected to your new domain.
    The .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed)

    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L] 
    

    In addition to the redirect I would suggest that you contact every backlinking site to modify their backlink to point to your new website.

    Note: This .htaccess method of redirection works ONLY on Linux servers having the Apache Mod-Rewrite moduled enabled.

    Refer this for more methods

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following redirects in my htaccess file Redirect 301 /communityed/index.htm http://www.domain.com/community_education Redirect
In htaccess, how do you 301 redirect dynamic pages? For example, what if I
How to make 301-redirect of specific pages with ? in their urls? Example: http://domain.com/cat/?id=1
I have the following in a .htaccess file redirect 301 /page.php http://domain.com/page Which works
In the .htaccess file: Redirect 301 /john-biography.php /about When I type domain.com/john-biography.php in the
I want the htaccess Redirect 301 to do the following using regex: http://example.com/folder/abc_123_123.htm to
I need to create a htaccess 301 redirect that redirect all www.mydomain.dk/40005/ (Where 40005
I am using a 301 redirect command in .htaccess file Redirect 301 /fr/emergency http://www.sitename.com/fr/d’urgence
The following htaccess rule doesn't work because of the umlauts. Redirect 301 /xyz/händedruck.html /new/händedruck.html
I read somewhere that using .htaccess for 301 redirect is not recommended and that

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.