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

  • SEARCH
  • Home
  • 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 7218845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T21:32:18+00:00 2026-05-28T21:32:18+00:00

I have this rule in an .htaccess file located in a directory named clips/

  • 0

I have this rule in an .htaccess file located in a directory named clips/:

RewriteRule ^mlk/?$ segment/index.php?clip=1 [R=301,QSA,L]

What I am intending is that when someone visits http://example.local/clips/mlk they are redirected to http://example.local/clips/segment/index.php?clip=1

What actually happens is that when someone visits example.local/clips/mlk they are redirected to example.local/var/www/example/clips/segment/index.php?clip=1

I’m not sure why it’s doing this. If I change the rewrite rule to this:

RewriteRule ^mlk/?$ /segment/index.php?clip=1 [R=301,QSA,L]

The user is redirected to example.local/segment/index.php?clip=1, which is still incorrect. I don’t want to have to specify an absolute path in the case of these files being moved around the website’s directory tree. How can I get this to work relatively instead of absolutely?

  • 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-28T21:32:18+00:00Added an answer on May 28, 2026 at 9:32 pm

    Try adding a RewriteBase directive as below

    RewriteEngine On
    RewriteBase /clips/
    
    RewriteRule ^mlk/?$ segment/index.php?clip=1 [R=301,QSA,L]
    

    EDIT

    but is there any way to get this to work without using a RewriteBase directive

    You could also try

    RewriteEngine On
    
    
    RewriteCond %{REQUEST_URI} ^(/[^/]+/) [NC] 
    RewriteRule ^mlk/?$ http://%{HTTP_HOST}%1segment/index.php?clip=1 [R=301,QSA,L]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have a .htaccess file set up with this rule: RewriteRule ^([a-zA-Z0-9_-]+)$ user\.php?user=$1
I have a this .htaccess rule for my lease form RewriteRule ^(lease)$ index.php?route=$1 [L]
Currently my htaccess file contains this rule, to redirect website.org/index.php to website.org/en/home RewriteRule index.php
I have this htaccess rule to redirect my page to data_parser.php RewriteEngine On RewriteRule
I have this rule: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !index.php RewriteRule ^(.*)$ index.php?req=$1
I have this rewrite rule in my .htaccess file, but in PHP when I
In my .htaccess file I have the following rule defined. RewriteRule t/([^.]+)/$ /video/tag.php?tag=$1 [QSA]
I have the following rule rule in my .htaccess file RewriteRule dest/(.*)/item/(.*)/aId/(.*)/tId/(.*)/? rss.php?dest=$1&item=$2&aId=$3&bId=$4 [NC,L]
I have this in my .htaccess file: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteRule !\.(gif|jpg|png|css|js|ico|flv|php|txt)$
I have the following rewrite rule in my .htaccess file: RewriteRule ^([^/]+)/([^/]+)/(tab:([^/]+)/?)?(scope:([^/]+)/?)?(sort:([^/]+)/?)?(p:\d+)/?)?$ web/results.php?view=$1&q=$2&tab=$4&searchscope=$6&sortBy=$8&page=$10 [NC,QSA,L]

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.