• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Form

New Here ,
Apr 09, 2018 Apr 09, 2018

Copy link to clipboard

Copied

Hi Dreamweavers!

I‘m not quite sure how to explain it, but I want to do the following:

For example, when someone types ‘apples’ I want my site to go to domain.com/apples, or when someones types ‘bananas’ I want the site to go to domain.com/bananas.

I don’t know if this is even possible, I tried looking for it on the internet, but I couldn’t quite figure out how to phrase the issue.

If it is possible, I would love to learn how. If it’s not, I’d like to know too, then I can stop thinking about it.

Thanks people!

Views

354

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Apr 10, 2018 Apr 10, 2018

MischaKemna  wrote

Then I would like the site to go to domain.com/rubbish. So basically each input should have it’s own result. It’s so a company can enter their company name and then the site shows a specific page for them.

You can do that. I'm assuming the specific company pages are all housed on your website. See code below.

For testing make a page called adobe_dreamweaver.html (this is a company page - use underscores between words in a url, its good practice to do so) then use the below code f

...

Votes

Translate

Translate
Community Expert ,
Apr 10, 2018 Apr 10, 2018

Copy link to clipboard

Copied

Not sure what you want to do. If I type 'rubbish' where do you want the site to go?

Wappler, the only real Dreamweaver alternative.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 10, 2018 Apr 10, 2018

Copy link to clipboard

Copied

Then I would like the site to go to domain.com/rubbish. So basically each input should have it’s own result. It’s so a company can enter their company name and then the site shows a specific page for them.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 10, 2018 Apr 10, 2018

Copy link to clipboard

Copied

MischaKemna  wrote

Then I would like the site to go to domain.com/rubbish. So basically each input should have it’s own result. It’s so a company can enter their company name and then the site shows a specific page for them.

You can do that. I'm assuming the specific company pages are all housed on your website. See code below.

For testing make a page called adobe_dreamweaver.html (this is a company page - use underscores between words in a url, its good practice to do so) then use the below code for the search code.....this search code can go in any page you want. If a company name match is found the company page will open, if a match is not found an error page will appear, you will need to set a default error page up on you server, if there isnt already one.

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title>Search company name</title>

<script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="

crossorigin="anonymous"></script>

<script>

$(document).ready(function(){

$('.search_company_name').css('cursor' , 'pointer').click(function(){

let company_name = $('.company_name').val();

company_name = company_name.replace(/\s+/g, '_');

company_name = company_name.toLowerCase();

window.location = company_name + '.html';

});

});

</script>

</head>

<body>

<input type="text" class="company_name" placeholder="Company Name">

<input type="submit" name="submit" class="search_company_name" value="Search">

</body>

</html>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 10, 2018 Apr 10, 2018

Copy link to clipboard

Copied

I added the code. But how (where) do I add the company names and results?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 10, 2018 Apr 10, 2018

Copy link to clipboard

Copied

MischaKemna  wrote

I added the code. But how (where) do I add the company names and results?

As I said you would make a page for each company, for example abobe_dreamweaver.html and insert the results for Adobe Dreamweaver in that page. If someone enters Adobe Dreamweaver in the search box they will get taken to adobe_dreamweaver.html

Also as I said this assumes that the results pages are in your complete control and youre not trying to search for a random Company Results pages outside of your website.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 10, 2018 Apr 10, 2018

Copy link to clipboard

Copied

Thank you so much! It works.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 10, 2018 Apr 10, 2018

Copy link to clipboard

Copied

I do have one more question concerning this topic.

What if I want to password protect each of the resulting company pages by a different password?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 10, 2018 Apr 10, 2018

Copy link to clipboard

Copied

MischaKemna  wrote

I do have one more question concerning this topic.

What if I want to password protect each of the resulting company pages by a different password?

Unless you are using php, a server language, then you're probably best advised to create a seperate folder for each company with the company name like:

adobe_dreamwever

Inside the adobe_dreamwever folder create an index.html page and insert the results for the company Adobe Dreamweaver in the index.html file

Then change the last line of the script to:

window.location = company_name + '/index.html';

To password protect the folder you can do that through your online websites control panel. Most control panels will allow you to password protect folders. I think that may work, although I havent tried it.

Of course if you ARE using php, a server language, all this would be done using a database to store the company name and results, password and you could produce a much nicer user interface than what you get by just password protection of a folder via the control panel.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 10, 2018 Apr 10, 2018

Copy link to clipboard

Copied

Would I also need MySQL for that? Or is there another option?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 10, 2018 Apr 10, 2018

Copy link to clipboard

Copied

MischaKemna  wrote

Would I also need MySQL for that? Or is there another option?

You only need to use MySql, which queries a database for data, if you are using php, other database languages and server languages are available but I dont know much about them.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 10, 2018 Apr 10, 2018

Copy link to clipboard

Copied

LATEST

Okay! I will try getting a database up and running soon. Thanks!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines