redirect

redirect urls from specific folder to external domains (with php?)

爷,独闯天下 提交于 2021-02-20 04:36:05
问题 The site i need this for is a wordpress site, Basicly my /out/ folder is followed by an url of a partner. i want people that go to such a link to get forwarded to that url I know there are plugins to do this manual, but i will need thousands of urls, so i basicly want to do it with a wildcard somehow Is this possible to do with php? https://example.com/out/https://externaldomain.com should go to https:// externaldomain.com this part will change, but is always an url: https://example.com/out/*

WooCommerce Add to cart redirection to previous URL

自闭症网瘾萝莉.ら 提交于 2021-02-20 04:19:47
问题 At the request of users, I need the add to cart button on the individual product page to redirect users to the previous page after clicking add product to cart. With following code, customer returns to a specific page (in this case the shop page): function my_custom_add_to_cart_redirect( $url ) { $url = get_permalink( 311 ); // URL to redirect to (1 is the page ID here) return $url; } add_filter( 'woocommerce_add_to_cart_redirect', 'my_custom_add_to_cart_redirect' ); with this code the users

Too many redirects error using Python requests

狂风中的少年 提交于 2021-02-19 05:28:38
问题 HTTP requests are working fine on my localhost, but running the same HTTP requests using the python requests library on my server returns a "Too Many Redirects" error When I enter localhost/terminal/jfk in a browser, I get a json dictionary as expected. However, when I run the following in python using the python requests library on my server requests.get('http://splitmyri.de/terminal/jfk') I receive a "Too Many Redirects" error from the requests module. Any thoughts as to what's causing the

Too many redirects error using Python requests

扶醉桌前 提交于 2021-02-19 05:28:11
问题 HTTP requests are working fine on my localhost, but running the same HTTP requests using the python requests library on my server returns a "Too Many Redirects" error When I enter localhost/terminal/jfk in a browser, I get a json dictionary as expected. However, when I run the following in python using the python requests library on my server requests.get('http://splitmyri.de/terminal/jfk') I receive a "Too Many Redirects" error from the requests module. Any thoughts as to what's causing the

404 issue in two htaccess in root domain and subfoler

旧城冷巷雨未停 提交于 2021-02-19 03:58:21
问题 My root domain htaccess: Options +FollowSymLinks RewriteEngine on RewriteBase / ErrorDocument 404 /404.php RewriteCond %{`HTTP_HOST`} ^www\.(.*)$ [NC] RewriteRule ^(.*)$ `https://%1/$1` [R=301,L] RewriteCond %{HTTPS} !on RewriteRule (.*) `https://%{HTTP_HOST}%{REQUEST_URI}` [R=301,L] In my subfolder htaccess: RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} `^(www\.example\.com)?$` RewriteRule ^(.*)$ `https://example.com/subfolder/$1` [R=301,L] Wehn I type in example.com/any-wrong-url

Redirect Website Homepage Only

社会主义新天地 提交于 2021-02-18 22:52:18
问题 I have two different websites that are hosted on different servers. I would like to redirect the homepage of the old site (www.oldsite.com.au) to the homepage of the new site (newsite.com.au). However, I do not want any pages within the old site (www.oldsite.com.au/page) to redirect to the new one (newsite.com.au/page). So, www.oldsite.com.au must redirect to newsite.com.au, but any other pages or files within the old site must not redirect. All the .htaccess ideas I've tried just redirect

Allow a page to only load in an iframe

谁说胖子不能爱 提交于 2021-02-18 15:12:33
问题 How can I allow my PHP file to only load in an iframe ? For example: Prevent direct access: example.com/Loader.php Allow iframe access: <iframe name="TEST" src="Example.com/Loader.php"></iframe> 回答1: You wouldn't use PHP for that. Try javascript. if(window==window.top) { // not in an iframe } 回答2: Supposing that you have file file1.php that have an iframe within and this iframe point to file2.php code supposed for the file file1.php : <iframe src="file2.php" width="500" height="100"></iframe>

Allow a page to only load in an iframe

孤街浪徒 提交于 2021-02-18 15:06:31
问题 How can I allow my PHP file to only load in an iframe ? For example: Prevent direct access: example.com/Loader.php Allow iframe access: <iframe name="TEST" src="Example.com/Loader.php"></iframe> 回答1: You wouldn't use PHP for that. Try javascript. if(window==window.top) { // not in an iframe } 回答2: Supposing that you have file file1.php that have an iframe within and this iframe point to file2.php code supposed for the file file1.php : <iframe src="file2.php" width="500" height="100"></iframe>

Allow a page to only load in an iframe

走远了吗. 提交于 2021-02-18 15:04:27
问题 How can I allow my PHP file to only load in an iframe ? For example: Prevent direct access: example.com/Loader.php Allow iframe access: <iframe name="TEST" src="Example.com/Loader.php"></iframe> 回答1: You wouldn't use PHP for that. Try javascript. if(window==window.top) { // not in an iframe } 回答2: Supposing that you have file file1.php that have an iframe within and this iframe point to file2.php code supposed for the file file1.php : <iframe src="file2.php" width="500" height="100"></iframe>

Difference in pipe and file redirection - BASH

独自空忆成欢 提交于 2021-02-18 08:10:29
问题 Redirection is used to redirect stdout/stdin/stderr! Ex: ls > log.txt. Pipes are used to give the output of a command as input to another command. Ex: ls | grep file.txt Why exactly are these two operators doing the same thing? Why not just write ls > grep to pass the output through, isn't this just a kind of redirection also? I realize Linux is "Do one thing and do it well", so there has to be more of a logical reason that I'm missing. 回答1: You do need a differentiating syntax feature - and