magento 2 rewrite url - redirect

I have static web site for example returns
I have multi language shop setup. So for German it would be german/ruckgaben.
However when i user only ruckgaben it shows me 404, that is expected because its invalid url.
However when i use returns and english/returns its showing me content(its the same but i want to be available on only one url).
How can i force only english/returns to work ? Either by 404 on returns or redirect to english/returns. I try using magento 2 url rewrite system but i rewrite returns(request)->returns(target).

By looking at your issue, you might have to follow below steps to fix the issue
Go to Magento admin -> Marketing Menu -> SEO & Search -> URL Rewrites
Search for ruckgaben(404 page) url from url list and edit it
Delete that url from click on delete button
Add new url rewrite, in which from select drop down select url type like for category, for product , for cms page etc
Select store which you want
Add request path like ruckgaben in your case
If you select create URL rewrite like for category, for product , for cms page then target path is filled automatically
Now save the url rewrite
And do reindex command and run the 404 URL
By following above steps, your -- issue should be resolved.

Related

URL change according to site location in Liferay

I would like to create a website on Liferay 6.2 and would like to master a URL such as this one:
www.NomDomaine.com/web/NP/nom_page
I would just change the NP as part (city name) to display the payroll name based on the location of the site.
I created the site with the page it's still this spot to display the name of page under ISO format by exmple : France => fr.
From your explanation I assumed that you would like to have your page URL as www.NomDomaine.com/web/NP/nom_page
To achieve this,
Go to Control Panel->Portal Settings,and under the Virtual Host Place www.NomDomaine.com and Save
Then, go to Control Panel->Sites->, then click on Configuration, you can find Site Settings, click on it and go to Site URL, and under the Friendly URL, type **/NP* and Save
Now you can access any of your site page with the URL www.NomDomaine.com/web/NP/nom_page

Creating a page on CMS

For example:
I create a page on Joomla or Wordpress and then save it.
I create an entry in the menu that points to the new page.
When I select the new entry in the menu the page opens on the browser.
The URL that appears points to a file that doesn't exist on the server.
What is the mechanism that is used by a CMS like Joomla or wordpress to accomplish this?
This is typically done with a URL rewriting module that runs on the web server (mod_rewrite for Apache or URL Rewrite for IIS on Windows). It will rewrite a request URL like /blog/article-title to something like /index.php/blog/article-title or /index.php?q=blog/article-title before the website code even sees the request. Then, the code in index.php extracts the rest of the path and determines which content to serve based on that.
For Wordpress, see http://codex.wordpress.org/Using_Permalinks for some info about how the rewrites are set up.

magento: products not showing up on the frontend : no code

I'm still new to learning Magento. I only followed a tutorial but it's not working. I added a new product and associated it to all categories just as a test. The tutorial would show the image of the product once he clicks on a subcategory but mine didn't.
It gives me this error:
The requested URL /magento/sample-sub-cat-1-tutorials/sample-sub-category-2.html was not found on this server.
What is wrong? I'm doing everything in the admin panel without coding as a start.
That is an error page returned by your web server software, not a Magento-handled 404 page. Try adding index.php before your url string i.e. site.com/index.php/magento/sample-sub-cat-1-tutorials/sample-sub-category-2.html; if that works, you need to check server rewrites (System > Configuration > Web > Search Engines Optimization) or check that rewriting is available for your web server software.

Where are subdomains ("shortcuts") defined in TYPO3?

On a corporate website managed with TYPO3 there are shortcuts defined which lead to a page on the site.
Example:
Corporate website is www.acompany.com
Then there is a site www.acompany.com/coolproduct which is redirecting the user to www.acompany.com/products/productgroup3/product25.htm for example.
Where in TYPO3 can such "shortcut" links be defined?
Most probably some page in the page tree has set type to: Shortcut which causes that it points some other page or resource, it's also possible that is set as Link to External URL and there is full URL given.
Check the page tree in the backend and find your coolproduct page in it. Then check the site's properties and change if required to other value/type.
It's also possible that this URL is generated by some plugin or TypoScript, but in this case you'll need to investigate it yourself.
Simplest way to find these kinds of things is actually using the search engine in the TYPO3 backend. You will find it in the upper right corner.
If this fails, what I do is install PhpMyAdmin from the extension repository. Once you have PhpMyAdmin you can use it's search functionality to find anything in the database using a search query of: '%coolproduct%' and selecting all tables. In the results look for the 'pid' field. It tells you on which page in TYPO3 the found item is located.
Does the page use the extension realURL? If so, there might be realURL redirects defined.
Have a look at page -> info -> RealUrl -> Redirects
Maybe you the user has defined this link redirection in many pages, you can search for it in the database exactly in the tt_content table.
You can set shortcut for your domain to any page of your site, so when user enter only your domain name in url then it redirects to page which you set in shortcut.
For that edit your domain and set shortcut to any page of your page tree.

How to redirect 404

For example in past my website look like this:
Example: www.mywebsite.com/keyword
Now look like this:
Example: www.mywebsite.com/search.php?q=keyword
How can i redirect people who search for a specific tag to my new link?
From "www.mywebsite.com/keyword" to "www.mywebsite.com/search.php?q=keyword"
I'm not so good with coding so based to my examples can somebody make the code that need to be inserted in htaccess file pls.
This are the examples of links:
OLD: www.mywebsite.com/keyword
NEW: www.mywebsite.com/search.php?q=keyword
That redirecting is called URL Rewriting, and is usually done via a .htaccess file for Apache, or with magic if you're using Lighttpd.
I would take a look at this website, which more or less explains how to do it (assuming you're running Apache): http://www.yourhtmlsource.com/sitemanagement/urlrewriting.html
The specific details depend on the web server being used (IIS, Apache, etc.) but basically you could configure those to redirect to a specific web page and extract the keyword from the original URL and place it in the query string parameter list.
For example, in IIS you would do the following:
Start > Programs > Administrative Tools > Internet Services Manager
Select your web site from the list and right-click to go Properties.
The Custom Errors tab is where you will see a list of HTTP errors.
Select the "404" page and "Edit Properties" to point this to a web page of your choosing.
The last step is where you will plug in your custom code that will handle the redirect.