Membership is FREE – with unlimited access to all features, tools, and discussions. Premium accounts get benefits like banner ads and newsletter exposure. ✅ Signature links are now free for all. 🚫 No AI-generated (LLM) posts allowed. Share your own thoughts and experience — accounts may be terminated for violations.

Avoid repeating a domain name

ian

Joined
Jan 10, 2008
Posts
4,053
Reaction score
753
The holding page I'm working on currently requires me to enter the domain name a few times in various bits of the html code (and contact form). Is there a way in which I can add the domain name once, and then reference it with some kind of basis code everywhere else, so it is quicker when I set up a new page.

Something like thisismydomain.co.uk, and everywhere else NAME={domain-name}. You get the jist (hopefully!).
 
If you're using a static html page you could include jquery and then wrap something around each occurrence eg <span class="domainName"></span> then just have a piece of code that runs on page load $(".domainName").text("whateverdomainyouwant"); That would change all occurrences
 
Rob's way is ideal. Even if your working in html you can essentially just change the extension to .php and it will work once on server. PHP var defo the way to go.
 
Thanks guys. It is a static page built from HTML, with a php contact form and a few jquery type files for opening stuff on the page. It was a bought option, I didn't create, so I'm struggling a little with the best method...or whether this is a seo no no to mask/hide the name too much?
 

Rule #1: Be Respectful

Do not insult any other member. Be polite and do business. Thank you!

Members online

Premium Members

New Threads

Domain Forum Friends

Lastest Listings

Our Mods' Businesses

*the exceptional businesses of our esteemed moderators
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Siusaidh AcornBot:
    Siusaidh has left the room.
      Siusaidh AcornBot: Siusaidh has left the room.
      Top Bottom