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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T12:22:25+00:00 2026-05-31T12:22:25+00:00

I have a template page and want to replace my placeholder variable used in

  • 0

I have a template page and want to replace my placeholder “variable” used in the path of all src=”” and href=”” on the page.

Paths look like this:

 <link rel="stylesheet" type="text/css" href="css/VARIABLE/custom.css" />
 <img src="http://somewhere.com/VARIABLE/img/1.jpg" />

which I want to change to:

 <link rel="stylesheet" type="text/css" href="css/set-value/custom.css" />
 <img src="http://somewhere.com/set-value/img/1.jpg" />

I first tried this with javascript/jquery client side, but I can’t get it to work properly.

So I’m wondering whether this is something I can do in .htaccess? I’m a total .htaccess newbie, so some pointers on where to start would also be appreciated.

Thanks for help!

  • 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-31T12:22:27+00:00Added an answer on May 31, 2026 at 12:22 pm

    You could use

    RewriteRule  ^/var1/(.+)$                 /value1/$1 [L]
    RewriteRule  ^/var2/(.+)$                 /value2/$1 [L]
    RewriteRule  ^/var3/(.+)$                 /value3/$1 [L]
    # ...
    

    But I’m pretty sure there are better ways to accomplish your goal. Why do you need this, what are you trying to do?


    EDIT

    You could use a special php page instead of the “variable”, e.g.:

    <link rel="stylesheet" type="text/css" href="/variable.php/css/custom.css" />
    <img src="/variable.php/img/1.jpg" />
    

    Then in variable.php use $_SERVER['PATH_INFO'] to get the trailing path, i.e. /css/custom.css or /img/1.jpg respectively. Then point to the correct file you want for each client (maybe based on the cookie value?).

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

Sidebar

Related Questions

I have a page template where I want to list entries for each child
I want to emit some js from jQuery templates e.g I have template like
I have a django template page, and want a link from this page, containing
I have a home page template and I want to pull content from other
I have an ASP.Net web page, which uses a Master Page template. The page
I have just meticulously followed MS instructions for customising a dynamic data page template
I have an e-mail template which is just a plain, static HTML page. I
I have template that looks like this: 100 template<size_t A0, size_t A1, size_t A2,
This a template page in my wordpress (have removed html), it pulls out the
I have many custom wordpress page templates and I want to keep them in

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.