FAQ Database Discussion Community


Nop Commerce automatically redirecting to different URL

.htaccess,web-config,url-redirection,nopcommerce
I am having a very peculiar issue. For some specific url nop website redirects to another url. For example - This is the url that is supposed to go - when clicked or even pasted in address bar, I debugged the code and in the application_beginrequest method notice the url...

Redirect all pages to a sub directory of the website

apache,.htaccess,mod-rewrite,url-redirection
Is it possible to redirect all pages of a website to a sub directory of that website, keeping original URL at the end of the redirected URL? Something like: www.example.com/hello-word -> www.example.com/blog/hello-world Or in other words, a wildcard redirect to a sub folder, I think....

301 Redirect Regex Pattern - Sitecore Redirect module

regex,redirect,sitecore,url-redirection
I apologize if this seems like a rudimentary question, but I'm trying to setup a redirect pattern for the 301 module in Sitecore and am having a hard time with the proper pattern. I need to have the following path: http://www.example.com/some-path/videos/2014/08/08/15/20/some-item-title converted to: http://www.example.com/some-path/videos/some-item-title Basically strip the numerical folders out....

How to change the root of a website in .htaccess every year?

.htaccess,mod-rewrite,redirect,url-redirection,http-redirect
I want the root of a website change every year to a directory named by that year using an .htaccess file. Simply I want this url http://www.example.com/ redirect to this url http://www.example.com/YYYY/ where the YYYY is an actual year (e.g. 2015) using .htaccess file. I have multiple questions: Which HTTP...

How to redirect in “NEW” tab with meta

html,url-redirection,meta
Ho can we redirect a page in new tab when we use meta tag. For ex. i am trying this code <meta http-equiv="refresh" content="5;URL=http://www.example.com > but it redirects it in same page. And if i add the following code after the url then also nothing happens target = "_blank" Please...

how to redirect empty parent category to its first non empty child category in wordpress

wordpress,parent-child,category,url-redirection
In Wordpress, If parent category is empty then it will redirect to its first child category that is not empty.

How to redirect a domain to another without having SEO issues?

dns,seo,url-redirection
I have two domains: mydomain.com and mydomain.fr . I want people who goes to mydomain.fr to see the exact same wordpress install (same content, articles, users etc and when they post on the .fr it also appears on the .com and vice versa) as the .com's . I can duplicate...

Redirectmatch 301 on Mediawiki

apache,.htaccess,redirect,url-redirection
I use Mediawiki script on my wiki site. I use site.com/Page link structure now. I used these link structures before: site.com/index.php/Page site.com/index.php?title=Page I want to redirect old links to news. I did it for "/index.php/Page" to "/Page". But i cant do it for "/index.php?title=Page" to "/Page". Here is my .htaccess...

URL Redirect Rule - Regex - How To Capture Part Of URL

regex,url-redirection
I am trying to write a redirect rule that will redirect the user only if the match the locales: en-us, zh-tw, fr-be. If they do not match these locales, the rule will ignore them. The user will be redirected to another site with just their country code. foo.com/en-us/bar => foo2.com/us/bar2...

Rails redirection to index instead of show

ruby-on-rails,ruby,url-redirection
I'm in my static page controller and I need to redirect to user index but it redirect me to user show, how can I fix it ? I tried redirect_to user_url, action: 'index' But it doesn't work, any idea ?

Redirect old website urls in new GAE/Python/webapp2 website

python,regex,google-app-engine,url-redirection,webapp2
To maintain search engine rankings, I am redirecting the URL paths from the old website (static html) to specified paths in the newly designed website. For example: if the old website contains /contact-us.html, the new website should redirect that path to /contact-us My approach involves creating a handler which simply...

redirect to new type of url and remove parts of the url with exception

regex,.htaccess,mod-rewrite,redirect,url-redirection
I need to redirect old links to new links. The new links will be a bit different. For example this (I have marked with capslook on the part that doesn't belong to the post name) http://www.example.com/VIEW-what-ever-dynamic-url-that-changes-RESOLUTION.html ("-RESOLUTION" is something like "-1400x1050" or "-other" etc. ) will redirect to: http://example.com/wp-content/show-image.php?path=http://example.com/wp-content/uploads/what-ever-dynamic-url-that-changes-RESOLUTION.jpg so...

Users are able to access a protected page using the direct link. How do I create a redirect?

php,html,mysql,redirect,url-redirection
I have a website assignment for my class and I ran into some trouble. When users access a protected page using the direct link they're able to access it still. But if they were to login to the homepage with incorrect credentials it won't direct them to the protected page....

Github pages/Jekyll Coldfusion redirect

redirect,coldfusion,jekyll,url-redirection,github-pages
I've just moved my Jekyll site to Github pages, however I realised that I have a couple of Coldfusion redirects - e.g. http://mysite/index.cfm?page=disclaimer. These links are relied on from various locations on the web, is there anyway I can make it work? I have read up on Jekyll redirect-from plugin,...

Redirect loop due to “Header may not contain more than a single header, new line detected in”

php,url-redirection
I'm trying to redirect to a URL and as it can be provided by the user, it may be somewhat invalid thus producing the warning message Header may not contain more than a single header, new line detected in and oddly enough PHP generates a redirect to the same page...

URL Rewrite rules appear to be redirecting instead of rewriting

iis,url-rewriting,url-redirection,url-rewrite-module
I am using IIS URL Rewrite 2.0 module to create a URL that always points to the latest version of my app. I have configured it as follows: <rule name="Latest" stopProcessing="true"> <match url="^latest(.*)" /> <action type="Rewrite" url="1.1{R:1}" /> </rule> The intention is that if something goes to /latest/* then all...

Multilingual website and url redirection to the default language chosen by me

url,url-redirection
I have a website with two languages, English and Russian. My domain url for each language will be as such: www.mydomain.com/en/ and www.mydomain.com/ru/ How do I redirect visitors to www.mydomain.com/en/ when they type: www.mydomain.com How will my url be shown in google search, will it be shown as: www.mydomain.com OR...

how to login into a website and get redirected url contents using c#

c#,webclient,url-redirection
I am trying to learn a process where I can login into a website and get download all the html of the website I can do this using webClient.DownloadString(@url); but the problem is that after login How can I get the redirected url. as I get the redirected url I...

How to retrieve redirect url given in window.location

python,beautifulsoup,web-crawler,python-requests,url-redirection
I am trying to make a crawler using Python. I am making use of beautifulsoup and requests library and need the set of URLs for a given website. However, in a certain part, there is redirect and when I print the response.text i.e the page content I get the following...

PHP Redirect Same Address Different Port

php,url-redirection
Right now I have this: header("Refresh: 0; url=http://192.168.100.100:10500/redirect2.php"); How can I do the same redirect but without writing address, only port? Both files are in the same folder on the same server. The thing is that I don't know the address that will be used to access this server (private...

How to redirect urls after deep level folder name change using rewrite rule

regex,apache,http-status-code-301,url-redirection
Our site spans across multiple languages (16 total), so the beginning of the url can contain 16 different subfolders. We have a subfolder beyond the lang/locale folder that has changed names so I am wondering how to redirect to the urls that involve the new subfolder name while also redirecting...

.htaccess rewrite with ? in url

.htaccess,redirect,url-redirection
For SEO reasons I need to redirect an old URL: /index.php?paginaid=1 to www.example.com/ But when I try it like this below it becomes www.example.com/paginaid=1 Doesn't work: RewriteRule ^index.php?paginaid=1$ http://www.example.com/ [R=301,L] Doesn't work: RewriteCond %{QUERY_STRING} ^paginaid=1$ [NC] RewriteRule ^index\.php$ http://www.example.com? [R=301,NE,NC,L] Any idea how to fix this? My total .htaccess: RewriteRule...

How to Add Iframe Current Domain on Visiting?

javascript,jquery,dns,url-redirection,http-redirect
Listen this is main site link >>> http://magazinerpros.blogspot.com/ Now i want that if someone click on the above link. then it should open to hold another link too. like you see in Example #2. that hold extra frame link { http://www.inframe.com/p/preview.html? } before the main link. Example #2 http://www.iframe.com/p/preview.html?url=http://magazinerpros.blogspot.com/ I...

How to properly pass parameter in query string with redirect_to? (Rails 4)

ruby-on-rails,ruby,url-redirection,url-parameters,query-parameters
I'm building a contact form creation app with rails 4. Users can create contact forms (called Contactable in app), which when submitted creates a Contact and redirects the contact to the URL the user specifies. I'm trying to pass the contact's email address through the redirect as a query string....

Redirect A subdomain To A folder in the same Subdomain using .htaccess - Browser detection language

apache,.htaccess,mod-rewrite,url-redirection
I need to create a conditional redirect (browser language) and rewrite for apache that accomplishes the following redirect a subdomain to a folder of the same subdomain i.e subdomain.domain.com redirects to subdomain.domain.com/es (if the browser language is setup on spanish, es or es-es) subdomain.domain.com redirects to subdomain.domain.com/en (if the browser...

Htaccess redirect happens different for www and non www

.htaccess,url-redirection
I have redirected all non www to www url using the following RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] Next , The final url for categories required is : http://www.slidecorner.com/category/Design I have used this for achieving this RewriteRule ^/?category/(.*) category.php?ctitle=$1 This also works, but when i check this url...

Redirect domain to IP preserving domain name

wordpress,.htaccess,mod-rewrite,redirect,url-redirection
Howdie do, I need to redirect a domain to an IP address but preserving the domain name For example, when a user enters jeremysdomain.com/wp-admin, it should redirect them to the IP 123.456.789.123, but the hostname should still be jeremysdomain.com/wp-admin I currently have my .htaccess with the following: Redirect permanent /...

jsf: redirecting from bean on primefaces ajax event

ajax,jsf-2,primefaces,url-redirection
I have this selectable PrimeFaces Tree with an Ajax listener on selection in my index.xhtml: <p:tree value="#{seccionesArbolView.root}" var="node" selectionMode="single" > <p:treeNode> <h:outputText value="#{node.nombre}" /> </p:treeNode> <p:ajax event="select" listener="#{seccionesArbolView.onNodeSelect}"></p:ajax> </p:tree> The listener method is on a session scoped named bean, and should redirect to another page (grupal.xhtml) with some GET parameters....

Android Studio - Webview - shouldOverrideUrlLoading - Do not open web browser

android,url,webview,url-redirection
I developed a Webview app with Android Studio but when the user clicks a link from a web page in the WebView, Android is opening the default web browser. I already checked on Android Developers API Guides how to do but it does not work ;( on my app ......

Change target link based on visitor's country

redirect,url-redirection
I have website.com/sample-page with some text and a download button (external link like download.com/file) I want to change the target link (download.com/file) if a user is from France. I dont want to redirect entire page/website, only this link. I am using wordpress (if helps). Some advices, please....

.htaccess Too Many Redirects (Combining 404 With Remove www)

apache,.htaccess,mod-rewrite,url-redirection
Using .htaccess, I'm able to remove www from my site url or I'm able to handle 404 redirects for any nonexistent page on my site. However, if I try to have both, I get an error saying "too many redirects" and my site won't load anymore. How can I fix...

Wordpress website: .htaccess erased

wordpress,.htaccess,mod-rewrite,url-redirection
I have a website made with wordpress 4.2.2. Sometimes my .htaccess is erase by an older version, which look like that. # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress I've added...

header() not working in php when the url contains parameters? [closed]

php,redirect,http-headers,url-redirection,http-redirect
So I'm using $_GET to capture the URL to use it later but when I use $_GET it wont redirect! So here's my sample code: URL : http://localhost/project/active.php/?s=ieugfshd&h=qwuyrbcq&i=1 php code: <?php include 'init.php'; $s = trim($_GET['s']); $h = trim($_GET['h']); $i = trim($_GET['i']); $q = key_check($s,$h,$i); if($q == 1) { header("location:password_active.php");...

Redirect main domain to subdomain, but keep a subdirectory

.htaccess,mod-rewrite,url-rewriting,url-redirection
Redirecting domain to subdomain seems easy using RewriteCond %{HTTP_HOST} www.example.com RewriteRule (.*) http://sub.example.com/$1 [R=301,L] but how can I keep a single subfolder working without redirecting to subdomain? so www.example.com/a-page AND example.com/any-page(.html or not) will be redirected to sub.example.com/any-page(.html or not) BUT I want a subfolder (just a single one) www.example.com/music/any-page(.html...

.htaccess redirect “site/download/post/” to “site/post/”

wordpress,.htaccess,url-redirection
Need some help here... How can i permanently redirect with .htaccess this URL: mysite.tdl/download/post-name/ to this URL: mysite.tdl/post-name/#ert_pane1-5 Actually i would like to know how to redirect to this URL too: mysite.tdl/post-name/ Its WordPress and Download Manager plugin related. What im trying to do is avoid visitors to reach the...

Move wordpress installation from subdomain to root and keep links

wordpress,seo,url-redirection
ok this is bit weird question: here is my domain: hfarazm.com and wordpress installation at: blog.hfarazm.com I have lots of visitors and they have shared my blog and article links all over. I want to organize my site for separate section for tutorials, for blog, for portfolio and for other...

Redirect all URLs starting with a substring to a new url in Joomla 3.x

php,.htaccess,joomla3.0,url-redirection
I had to re-design a Joomla Listing site and the website used a component to show the listings. The url of the each item is as follows example.com/gulf-job-listing/jobs/items/view/xxxxx The xxxx is usually a combination of id and alias, so it might be something like this example.com/gulf-job-listing/jobs/items/view/1-programmer Anyways, what i'm trying...

how to redirect the URL in magento?

magento,url-redirection
how to redirect the URL in Magento if i click on category or subcategory it should show page which i have created because of responsive design i'm doing this I've created the URL for pages in such a way that the both category and subcategory URL is equal to page...

apache2 - https redirection to http for a given page

apache,.htaccess,mod-rewrite,url-rewriting,url-redirection
I have a specific problem about the redirection of HTTPS to HTTP for several pages. I have Apache2 in front of Zope 3 framework. Here's the configuration of my VirtualHost on port 80 : <VirtualHost *:80> ServerAdmin [email protected] ServerName website.com ServerAlias www.website.com <IfModule mod_rewrite.c> RewriteEngine On # www to non...

I need to do a redirect on a proxied path in Nginx

nginx,proxy,url-redirection
I'm working with a poorly architected app and I have a need to proxy / and redirect it to a sub-directory (unless someone can comeup with a better solution). Here's the layout of the paths the app uses: var securePaths = [ "/someaction", "/anotheraction", "/athirdaction", "/client/interfaceishere/index.html" //path to client interface...

PHP redirect form to URL not working

php,redirect,url-redirection
So I'm trying to use this http://www.formget.com/how-to-redirect-a-url-php-form/ as an RSVP form. Ideally, entering the right code on (http://baby.engquist.com/invite/) will lead you to a google form. However, when I enter any code (right or wrong) and press the button, it simply refreshes back to the /invite page. My code is as...

Redirecting one domain to another domains sub directory

dns,subdomain,url-redirection
I have been looking around on google and have had no luck. What am I trying to accomplish: I am trying to take my "domain1.com" and redirect it to "domain2.com/foo.php" is this possible?...

How to redirect on particular page in wordpress?

wordpress,url-redirection
<?php if($result_array['ACK']== 'Success') { wp_redirect( get_page_by_title( 'thank-you' ) ); }else{ //redirect like php header("Location : http://localhost/mysite/faq"); } ?> My query is working but I have no idea that how I simply redirect in my page and display any my page content data in wordpress. So please help me. ...

Redirect /7A/url to /fps/7A/url

html,.htaccess,redirect,url-redirection
I want to redirect any URL or text after /7A. So example.com/7A/testpage.php or example.com/7A/folder/ would redirect to: example.com/fps/7A/testpage.php or example.com/fps/7A/folder Would this be possible using .htaccess or even PHP? Would you use RedirectMatch in .htaccess? I tried something like this: RedirectMatch ^/7A/$ /fps/7A/$1? but I'm pretty sure it won't work....

Get browser url and append dropdown option value

javascript,jquery,url,url-redirection
I have created a dropdown for sorting items and on click of an option the page reload and display sorting result. Here is my code of dropdown <div class="sorting-option"> <label for="selectdropdown">Sort by : </label> <select id="selectdropdown" class="dropdown-select" name="selectdropdown"> <option value="&">Recommended Items</option> <option value="&sort1desc=F&sort1=Item_NAME">Name (A-Z)</option> <option value="&sort1desc=T&sort1=Item_NAME">Name...

nginx redirect old URL to new URL

redirect,nginx,rewrite,url-redirection
We just updated all our product url to new url. It only add some letter in the URL. An example old URL: http://www.example.com/parent/children/product.html new URL: http://www.example.com/new-parent/children/product.html (just added "new-" in "parent") I try with this but not work. location /parent { rewrite ^/parent(.*) http://$server_name/new-parent$1 permanent; } So anyone can help...

redirect certain pages to its equivalent in another domain, otherwise redirect to its homepage

apache,.htaccess,rewrite,url-redirection
I want to use htaccess to redirect certain pages to its equivalent in another domain, other pages redirect to homepage. Like that: http://old-domain.com/certain-page redirected to: http://new-domain.com/certain-page http://old-domain.com/another-certain-page redirected to: http://new-domain.com/another-certain-page Only these pages will be redirected, otherwise, pages have to be redirected to the new domain home page. http://old-domain.com/non-certain-page redirected...

Parameter 'id' to be query string in Grails redirection

grails,url-redirection
From Grails controller, I want to redirect to this (using query string): /mycontroller/myaction?id=3 I wrote this code: def a = 3; redirect (controller:"mycontroller",action:"myaction",params:[id:a]) This code will produces: /mycontroller/myaction/3 I know that 'id' is special parameter. It will be url not query string. I try another parameter def name = "John";...

URL redirection rule for .htaccess

apache,.htaccess,mod-rewrite,redirect,url-redirection
I need some permanent (301) redirection rule to redirect multiple versions of documents to new location. For example I have: www.domain.com/about/about.html www.domain.com/about/about.pdf www.domain.com/about/about.doc www.domain.com/about/about.rtf www.domain.com/about/about.txt and I need to redirect all of them to: www.domain.com/about Also I have URLs like this: www.domain.com/privacy_policy/privacy_policy.html www.domain.com/privacy_policy/privacy_policy.pdf www.domain.com/privacy_policy/privacy_policy.doc...

redirect all client http url with android hotspot

android,url-redirection
I try to make app to share my file with open my mobile hotspot, and friend can connect it . Then open browser key in url to download. I use iptables to redirect from port 80 to my web server port 8888, it works. But when I change /etc/hosts file/...

How to redirect pdf files to corresponding page?

apache,.htaccess,mod-rewrite,redirect,url-redirection
I have pdf urls for each of my pages. For example : https://seorooz.net/panda-algorithm/?print=pdf https://seorooz.net/panda-algorithm/ I want 301 redirect all request from pdf urls to original page urls. How can i do this from .htaccess file? Update:Solved.I have this code in my .htaccess file: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On...

ASP.NET MVC redirect OnEnd [duplicate]

c#,asp.net,asp.net-mvc,asp.net-mvc-4,url-redirection
This question already has an answer here: Redirecting to another page on Session_end event 6 answers I am trying to redirect when in method Session_OnEnd() in Global.asax If I type public void Session_OnStart() { HttpContext.Current.Response.Redirect("http://www.google.es"); } And go to Google but when I try this onEnd... public void Session_OnEnd()...