FAQ Database Discussion Community


htaccess redirect to other domain except for specific request

php,apache,.htaccess,mod-rewrite,redirect
We're stuck on a problem regarding .htaccess We need the website to redirect to another domain, except if the user wants the /intranet uri. Then it should just go on to index.php We tried the following but it's redirecting both RewriteEngine On RewriteCond %{REQUEST_URI} /intranet RewriteRule .* index.php [L] RewriteRule...

Magento 1.8.0.0 - Worldpay payment response receiving 301 error

php,magento,redirect,response,worldpay
Good Morning, I have recently been handed a Magento site that functions fine, however the callback integration between Worldpay and Magento seems to fail. E-mails are sent to me stating that the server is responding with a 301 error (I believe this is a redirection error). The URL that Worldpay...

301 Redirect entire site to new site using .htaccess file

.htaccess,mod-rewrite,redirect,http-status-code-301,http-redirect
Ive got a site siteONE.co.uk that i want to 301 permanent redirect all the pages to another site, siteTWO.co.uk For this im currently using the this .htaccess file below, but im have to type out a new line for each page i want to rediect even though they are all...

Redirect without changing Url htaccess

php,.htaccess,redirect
I'm wondering if this is possible - I have projects structured like: www.mydomain.com points to MyFolder on server. In MyFolder i have 3 App Folders eg MyFolder/App1, MyFolder/App2.. Each of these are 3 different web applications. Url of domain is www.mydomain.com Is it possible, that, when url user go to...

Apache htaccess redirect file

php,regex,apache,.htaccess,redirect
I want to redirect any request for file from my old website to the same file but with different url on my new website : www.oldwebsite.com/aaa/bbb/ccc/file.txt -> www.newwebsite.com/bbb/ccc/file.txt I have tried this solution on .htaccess file: RewriteEngine On RewriteRule ^(aaa/bbb/ccc/)(.*)$ http://newwebsite.com/bbb/ccc/$2 [R=301,L] but when I try with this url :...

Redirect specific Url variables

php,.htaccess,mod-rewrite,redirect
My site used to generate URLs like this: /data.php?s=1432862823&type=basic I have modified the program so the new URLs generated are: /d.php?s=1432862823&t=basic Since some people have bookmarked the old URLs I want to write a Rewrite rule that will get them to the new url. I've not this so far: RewriteEngine...

Timeout handle email php

php,email,redirect,location,sleep
I would like to redirect my user to a new page, but the current site continues to run a script that sends a threaded message 10 minutes later at a specified address. I tried something like this: Header('Location: xy.com'); sleep(100); do_the_email_sending_here(); But actually it doesn't worked,because the site waited for...

Redirect URLs using Redirect component or htacess

php,.htaccess,redirect,joomla
In Joomla 3.4 want to redirect this page: https://www.portal-gestao.com/component/k2/1422-como-i...%C3%A9tica-na-sua-empresa.html To this: https://www.portal-gestao.com/item/1422-como-i...%C3%A9tica-na-sua-empresa.html Using Compontent - > Redirect, I added the following redirect: /component/k2/1422-como-i...ética-na-sua-empresa.html Redirect to: https://www.portal-gestao.com/item/1422-como-i...%C3%A9tica-na-sua-empresa.html But this did not work. Then I added in .htaccess: RewriteEngine On RewriteCond %{HTTP_HOST}...

Redirect only non-existing sub-directories to another domain using wildcard

apache,.htaccess,mod-rewrite,redirect
In Apache, how do i redirect all non-existing directories for one domain (E.g. http://example.com/*.*) to another (e.g. http://example2.com/*.*)? I don't want the redirect to occur if the directory exists on the first server (http://example.com/). Just for non-existing directories. Example: http://example.com/directoryA <--- Exists on the server, so it should NOT redirect....

Javascript: OS-depending Redirects doesn't work for IOS

javascript,ios,redirect,apple
i've got a pretty simple Javascript for redirecting a specific URL to an app in Google-Play-Store/iOS-Store or show an URL for desktop users depending on the client's opersting system. For the ios case the redirect is not being executed, can anyone explain what the problem is? (alert before redirect is...

Redirect to View from AJAX call on error

javascript,jquery,ajax,asp.net-mvc,redirect
Problem: I would like to load a partialview into a DIV when success, but in case an error happened I need to redirect to the view home page. The issue is that the Redirect to Action is also loaded into the div resultdisplay. How should I manage the errorhandling to...

Htaccess regex: exclude REQUEST_URI

regex,apache,.htaccess,mod-rewrite,redirect
I really tried everything, the tool htaccess tester says that it's ok, but it's not really working. I want to redirect a subdomain to the main domain only if the REQUEST_URI doesn't start with 3 specific strings. I tried without success with: RewriteCond %{HTTP_HOST} ^sub.example.com$ [NC] RewriteCond %{REQUEST_URI} !(aaa|bbb|ccc) RewriteCond...

In Bash, how to not create the redirect output file once the command fails

linux,bash,shell,redirect,io-redirection
Usually we may redirect a command output to a file, as following: cat a.txt >> output.txt As I tried, if cat failed, the output.txt will still be created, which isn't my expected. I know I could test as this: if [ "$?" -ne "0"]; then rm output.txt fi But this...

RewritePath doesn't change browser URL

asp.net-mvc,redirect
Inside my Global.asax.cs I have the following simple code: void Application_BeginRequest(object sender, EventArgs e) { if (HttpContext.Current.Request.RawUrl.Contains("/oldControler/oldAction")) { HttpContext.Current.RewritePath("/newControler/newAction"); } } The above code causes redirection to "newControler/newAction" rendering the correct View, yet the URL that shows up in the browser is still "/oldControler/oldAction". In case it's of any help,...

How to redirect and then stop in node.js

javascript,node.js,redirect,express
I am trying to stop users accessing certain pages whilst logged in and not logged in with node.js. So far I have this idea: exports.blockIfLoggedIn = function (req, res) { if (req.isAuthenticated()) { //passport req.flash('error', 'Sorry but you can\'t access this page'); res.redirect('/'); } }; MA.f.auth.blockIfLoggedIn(req, res, next); res.render('users/login', {...

Validating pyramid requests

python,redirect,pyramid
I have a pyramid application with many defined routes. I want to do a few different server-side checks whenever a user makes a request and possibly redirect the request if certain criteria are met. I realize I could add these checks to each of the view functions, but I'd like...

How can I redirect all visitors to a subdirectory but still have access to the root directory for development

regex,apache,.htaccess,mod-rewrite,redirect
I'm about to start building a site and I've set up an "Under Construction" site at http://positivechange.cl I'd like to work directly on the root directory during development so that I don't have to move all files from a development subdirectory to the root directory, so I'd like to redirect...

Redirect 301 with wordpress articles from a domain to another

wordpress,.htaccess,redirect
my client changed his wordpress website to a new domain. I tried with the htaccess to redirect 301 the articles dynamicaly but it's not working. The URL format of articles are : /%year%/%monthnum%/%day%/%postname%/ I put this in htaccess but not working : redirect 301 /([0-9]*)/([0-9]*)/([0-9]*)/(.*)/ http://www.newdomain.com/$1/$2/$3/$4/ Can you help me...

Django redirect from generic.ListView class fails, attempts to reverse

python,django,redirect,django-generic-views
I am brand new at coding, still just trying to learn, so please go easy on me. I apologize in advance if my question offends anyone. Jumping right in, I am attempting to redirect from a generic list view like so: views.py from django.views import generic from django.shortcuts import HttpResponse,...

How to remove subdirectory using rewriterule with non-www redirection

regex,apache,.htaccess,mod-rewrite,redirect
So I've been fiddling with .htaccess and I was able to remove both removing a subdirectory and having a non-www subdirection. Please find code below: Options +FollowSymlinks RewriteEngine On RewriteCond %{HTTP_HOST} ^www.(.+)$ [NC] RewriteRule ^(.*) http://domain.com/$1 [R=301,L] RewriteCond %{REQUEST_URI} !(.*)subdir RewriteRule ^(.*)$ subdir/$1 [L] This can redirect: www.domain.com/subdir/file or www.domain.com/file...

mod_rewrite - force redirecting to rewritten URL

apache,.htaccess,mod-rewrite,redirect
I have following URL [1]: www.domain.com/?search=somequery which i want to redirect to [2] www.domain.com/search/somequery I am using following code in my .htaccess: Options +FollowSymLinks -MultiViews RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^search/(.*)$ /?search=$1 [L] Code above works kind of fine since server understands both URLs:...

Grails: Carry forward params on hyperlink is clicked

grails,redirect,controller
How to carry forward the parameters when hyperlink is clicked? Here is my gsp code: <g:link class="grid_link" controller="user" action="delete" id="${userInstance.id}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure, want to delete?')}');">Delete</g:link> Here is my controller code: def delete() { try { def userInstance = User.get(params.id) //deleting the user //successful. redirect(action: "list",...

.htaccess - 301 redirect where the URL structures aren't identical

regex,wordpress,.htaccess,mod-rewrite,redirect
I've been looking around for the answer to this but haven't been able to solve it myself. What I'm trying to do is redirect a group of around 1500+ URLs from one format to another, where the only thing that's consistent between the two is a string of numbers at...

Redirect domain.com/folder with www to non-www and at the same time http to https

.htaccess,redirect,https,subfolder,no-www
I have installed into a sub-folder of my domain a Web App. Example: domain.com/webapp I want to use the Web App with SSL enabled: https://domain.com/webapp I want to redirect at same time: WWW to NON-WWW and HTTP to HTTPS only for the sub-folder "webapp". Trying with the code fund in...

Is there way to ignore 302 Moved Temporarily redirection or find what it is caused by?

python,redirect,python-3.x,urllib
I am Writing some parsing script and need to access to many web pages like this one. Whenever I try to get this page with urlopen and then read(), I get redirected to this page. When I launch the same links from google chrome redirect happens but really rarely, most...

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....

Nginx redirect http subdomains to https

ubuntu,redirect,ssl,nginx,rewrite
I have one domain with 3 subdomains: - example.com (main domain) - api.example.com - blog.example.com - support.example.com (just a cname to point to zendesk) And I have this 3 configuration on my Nginx: api # HTTP server server { listen 80; server_name api.example.com; return 301 https://api.example.com$request_uri; } # HTTPS server...

PHP - Image Upload , move_uploaded_file not working?

php,redirect,image-uploading
I have coded a image upload script but when I click upload i get redirected to the upload page? Here is the code: $image1name = $_FILES['image1']['name']; $image1crntloc = $_FILES['image1']['tmp_name']; $image1ext = pathinfo($image1name, PATHINFO_EXTENSION); $image1size = $_FILES['image1']['size']; $allowedext = array("jpg","gif","png"); //check image 1 extension. if (!in_array($image1ext,$allowedext)) { echo "<script>alert(\"Image 1 has...

Rewrite Problen .htaccess Redirect 301

php,apache,.htaccess,mod-rewrite,redirect
I need put a redirect on a site and a have some problems. I have this original .htccess RewriteEngine on RewriteCond %{REQUEST_URI} \.json$ [NC] RewriteRule .* - [F,L] RewriteRule config/.* - [F,L] RewriteRule config - [F,L] RewriteCond %{REQUEST_FILENAME} -f [NC,OR] RewriteCond %{REQUEST_FILENAME} -d [NC] RewriteRule ^.+$ - [L] RewriteCond %{QUERY_STRING}...

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....

python requests with redirection

python,authentication,redirect,curl,python-requests
Trying to authenticate on http://72.ru site, noticed that there were a redirect to https://loginka.ru/auth/. Found that there were 302 POST with plain credentials in data form. Copying headers from Chrome can reproduce that in cURL, but still can't reach in requests module. Warning: page is full of russian letters, registration...

I'm using htaccess to redirect mobile users from desktop to website but i keep getting the $_GET variables inside

.htaccess,redirect,mobile
This question may look like its been asked already and i have seen them all, i've been looking and attempting a lot of answers AND answers that weren't approved. I have successfully made it so that if the user goes to desktop version it will go to the mobile site...

Extracting Wikipedia Articles: Redirects?

api,redirect,wikipedia
I'm working on something that shows the raw data on a wikipedia page. I've got it working really well, but I've run into an issue with redirects. Sometimes when the app goes to the page, it says, "This is a redirect from a title that is <b>fully protected</b> from editing...

Force WWW when URL contains path using .htaccess

.htaccess,session,url,redirect
I'm having a problem with my URL and my sessions. I wish to have ALL website pages be forced to use www. As it looks like now, the website looks like this: www.example.com into www.example.com example.com into www.example.com www.example.com/example/ into www.example.com/example/ example.com/example into example.com/example (this is what's wrong) This is...

Redirect files from Popen to subdirecotry

python,redirect,subprocess,stdout,popen
I have a pipeline composed of a number of scripts. Almost all of the scripts read and write to files, and some of the scripts in the pipeline have conflicting file formats (they will read and attempt to perform actions on files that they should not due to the files...

Redirect ranges of IPs in JavaScript (no .htaccess)

javascript,redirect,ip
ANSWERED - How to specify a range of IP addresses in a redirect Here's the working script: <script type = "text/javascript"> var blocklist = /^(10\.20\.30\.40|50\.60\.70\..*)$/; if (ip.match(blocklist)) { window.location.replace('http://fakeblog.com/'); } Will match IPs 10.20.30.40 as well as 50.60.70.* and redirect to a different page....

How to remove the word 'index' in the url [.htaccess]?

.htaccess,mod-rewrite,redirect,url-rewriting,file-extension
Currently, I am using the below code to remove the word 'index' in my urls - however, the issue is that it allows for two versions: one without and one with [the word] - hence, I have referenced the one without (in the HTML) - but the user still might...

Laravel 5 redirect after store

php,laravel,redirect,laravel-5,laravel-routing
How to redirect a route after store process at L5 ? My route is Route::get('/pages/aracislemler/{id}', ['middleware' => ['roles'], 'uses' => '[email protected]', 'roles' => ['Admin']]); And controller function public function store() { $brand_name = Request::get('brand_id'); $type_id = Request::get('type_id'); //$client_id = Request::get('representive_client_id'); if (!Brand::find($brand_name)) { $brand = new Brand; $brand -> brand_name...

Redirect /{POSTID}/{CATID}/{TITLE} to just /{POSTID}/

apache,.htaccess,redirect,rewrite
I need help with a rewrite / redirect rule to fix some duplicate content issues on my website. I have a URL structure that it causing a ton of duplicate content. The same page can be accessed with: /Static1/Static2/Static3/{POSTID}/{CATID}/{TITLE} /Static1/Static2/Static3/{POSTID}/{CATID}/ /Static1/Static2/Static3/{POSTID}/ So, there are 3 copies of every page. I...

PHP post to url

php,python,redirect,joomla
I have a python script that listen to specific port on a server and waits until it gets an http request from browser or program to run. I want that script to run when the admin on my Joomla site clicks on the save button. That means that I need...

C# mvc4 - direct URL to controller

c#,asp.net-mvc-4,url,redirect
I have an external URL that points directly to a function in my controller but when I click on it for the first time, instead of reaching the page, I get to the home page. However, on the second click (and the following ones), I can reach the desired page....

Naked Root Domain Hosting

redirect,amazon-web-services,amazon-s3,amazon-route53
The usual approach calls for pointing mysite.com to www.mysite.com. But suppose that I would like not to redirect. In other words, I would like to set up a naked root domain, without setting up any sub-domains, not even www.mysite.com. I am using Route53 and S3. Presumably I would need just...

Catchall rewrite rule after 1:1 301 redirect stops 1:1 redirect from working

regex,apache,.htaccess,mod-rewrite,redirect
I am implementing a 1:1 redirect in htaccess with something like this: Redirect 301 /1.html site.com/folder/1 Redirect 301 /2.html site.com/2 Redirect 301 /3 site.com/vw-vans/another-folder/2 Redirect 301 /3.html site.com/3 RewriteCond %{REQUEST_URI} .*\.(html) RewriteRule ^(.+\.html)$ site.com/folder? [R=301] What I was expecting here was if 1.html matches it will be redirected to site.com/folder/1...

.htaccess rewrite - redirect pages

apache,.htaccess,mod-rewrite,redirect,rewrite
I would like to know how could I redirect all visitor who is accessing the following addresses: https://example.com/anypage to https://example.com/search/anypage It cannot redirect people who is already at https://example.com/search/anypage to avoid loop. This is my current .htaccess: Options -Indexes +FollowSymLinks RewriteEngine On RewriteBase / RewriteCond %{HTTPS} off RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI}...

How to redirect a client to a website after having authenticated it?

asp.net,redirect
I have to implement a simple Single Sign On (SSO) solution between two existing internet applications hosted by two different companies. What it should do: The user log into application A with his username and password. The user eventually clicks on a button in application A to launch application B....

Get Parameter from URL using PHP

php,url,redirect
I have a url: domain.com/?city=newyork&postback=test I am currently successfully passing the postback parameter using the PHP below. However, I can not figure out how to also pass the city parameter. <?php session_start(); if(isset($_SESSION['postback'])) { if($_GET['postback'] == "") { header ("Location: qualify-step2.php?postback=".$_SESSION['postback']); } } ?> Can someone please help me edit...

Mod Rewrite Maintenance page that uses multiple URLs

windows,.htaccess,redirect,isapi-rewrite
I have a site the uses multiple URLs for a single application. Depending on the URL of the site you will get different content. I need to create a rewrite rule that redirects a user to a different page depending on what URL the user hits. For example: If a...

PHP redirect page works only in localhost

php,mysql,forms,redirect
I haven't found any solutions for my problem so I decided to ask. I would like to redirect my php script page after submitting a form, so I use header at the end of my codes! Interestingly, when I test it in my localhost, it works and redirects the page...

Magento Redirect all .htaccess keeping administration

apache,.htaccess,redirect
We did our new website and currently we have both in our host. We have made a 301 redirect from old site to new site. RewriteEngine On RewriteCond %{THE_REQUEST} !/new/ [NC] RewriteRule !^new/ /new%{REQUEST_URI} [NC,R=301,L] Right now, everything is redirect to /new but we need to keep old admin. Is...

Htaccess: HTTPS redirection on page + sub pages

apache,.htaccess,mod-rewrite,redirect,https
Im trying to set a htaccess rule that redirects all pages that come under a specific url to https they currently default to http. Im trying to set a overall rule that includes anything after the /enrolments/ page. As multiple locations are included and more being added, so i do...

Use JS to convert URL #fragment BEFORE it gets lost to 301 redirect?

javascript,redirect
In real trouble here. Our old website featured a gallery slider that used URL #fragments to position a jQuery slider on the right project. For instance, /work/interactive#777 brought you to the /work/interactive page--which shows one project at a time in a slider--and then animates the slider to project with the...

Manual 301 redirects in Opencart

regex,apache,.htaccess,redirect,opencart
I've changed a few URLs on my Opencart (version 1.5.6) website and then I've changed them one more time. Google started alerting me that there are dead links and now I'm trying fix things up by adding manual 301 redirects in .htaccess (I used to do this whenever I was...

Redirect htaccess automatic

.htaccess,redirect,website
initially I had the site up /beta/, and google me indexed pages, now I would like that when one goes up as http: //miosito.ext/beta/blabla become automatically http: //miosito.ext/blabla I tried redirect /beta/^([a-zA-Z0-9_-]+)$ http://miosito.ext/^([a-zA-Z0-9_-]+)$ but it does not work ... Any idea how can I do?...

htaccess rewrite rule is not working

php,apache,.htaccess,mod-rewrite,redirect
All, I'm trying to redirect the hits via htaccess redirect scripts. Below is my htaccess scripts. Options +FollowSymlinks RewriteEngine on RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^post/(.*)/$ post.php?tag=$1 [L] RewriteRule ^search/(.*)$ search.php?tag=$1 [L] Issue : Index and search page are getting redirected. Post page is...

Redirect stdout using exec in subscript

linux,bash,redirect,command-line,sh
I have one main script which is started as an service. I can't modify this main script, because it is often updated. This main script starts a program, which echo any log to stdout. So i can't see any log of this program. But this main script calls at the...

HttpResponseRedirect creates invalid redirect URL

python,django,.htaccess,python-2.7,redirect
I am a Django newbie. I am doing following in my view: if user_profile.key_expires < timezone.now(): form=RegForm() return HttpResponseRedirect('appname/index.html',{'form':form,'expire':True}) Basically, if the account activation key has expired, redirect to homepage with expire as True so that I can show a message that says the link has expired. Problem is, I...

.htaccess allow image to display directly

php,regex,apache,.htaccess,redirect
I have many files including images, php& js scripts and subfolders. I need to redirect to index.php for any uri using .htaccess. for example: www.example.com/test should be redirect to index.php But images should not be redirected to index.php. Instead it should be printed directly in browser. For example: www.example.com/sample.jpg should...

Redirect based on operating system

javascript,wordpress,redirect,user-agent
I'm new here and I apologize if this question is basic/stupid. I am not too familiar with coding, so please excuse my ignorance/glaring errors. I have tried to put this together using code snippets found online and luckily I don't have to code too much for this project. I am...

Cannot get wp_redirect to work

wordpress,redirect
I'm trying to send an email using wp_mail and then, if mail is sent successfully, redirect user to another page (or, if not successful, to an error page). My code is shown below. The email is actually sent, so wp_mail is working, but I cannot get the redirect to work....

Redirect all subdirectory links to another subdirectory

wordpress,apache,.htaccess,redirect,joomla
Need to redirect all blog links such as website.com/2015/03/post-title to website.com/blog/2015/03/post-title . So far nothing I used worked - neither redirect, nor redirectmatch. What happened was the website was redesigned from Wordpress to Joomla, so there's a Joomla .htaccess file on the root of the website, but the blog remained...

htaccess redirect subdirectory to root

apache,.htaccess,redirect
What rule can I add .htaccess that would give me the following result? I want to redirect to the homepage any search that includes a certain directory. For example, when anyone tries... test.com/example ...or... test.com/example/something ...they end up at... test.com Most everything I have tried kinda worked but always ends...

How do I redirect a URL with a parameter to a clean URL in htaccess?

.htaccess,mod-rewrite,redirect
I am attempting to 301 redirect several URLs with parameters at the end to clean URLs. For example I am trying to redirect: http://example.com/news/news.php?id=1234 to http://example.com/posts/vanity-url.php Here is my code: RewriteCond %{QUERY_STRING} id=1234 RewriteRule ^news/news\.php$ /posts/vanity-url.php [L,R=301] I feel like I'm close with this code but it redirects me to:...

HTACCESS 301 redirect issue with strange url variables

wordpress,apache,.htaccess,mod-rewrite,redirect
google webmaster tool is notifying me a 404 error about the following url: http://www.giobby.com/&force=1 I added the following rule to htaccess file, but it doesn't work: RewriteCond %{QUERY_STRING} ^&force=1 RewriteRule ^/?$ http://www.giobby.com/? [L,NC,R=301] Can someone suggest me the correct rules? ...

htaccess redirect to subdomain based on query string

php,apache,.htaccess,redirect,joomla
I searched for similar questions but none of them was applicable to my situation. What I need to do is redirect from old url's that have specific query string: option=com_virtuemart to a subdomain : http://parts.domain.com Tried bunch of rules and conds but haven't achieved right redirection. It was always redirecting...

Redirect to a homepage cakephp 3

php,redirect,routes,cakephp-3.0
I've followed the articles tutorial from cakephp 3 website and created the website http://i.imgur.com/JMh1Pwv.png Now there is add article, delete article and edit article actions. When I delete an article it redirect me to http://localhost:8888/test/articles/delete/14 Here is the delete code. public function delete($id) { $this->request->allowMethod(['post', 'delete']); $article = $this->Articles->get($id); if...

Why mozilla changes the characters when i use the .net mvc statement redirect?

c#,asp.net-mvc-4,redirect,mozilla
I'm trying to redirect to an external website when everything is done, but firefox changes the http word on the url for a weird set of characters. This is my server side code: [HttpPost] public ActionResult Postular(INFO_BASE_POSTULACION_model pInfoPostulacion) { string rutMD5 = Request["rutMD5"]; int idRegion = Convert.ToInt32(Request["idRegion"]); int idInstrumento =...

Redirect to random link from array

php,redirect
I have a script that is redirecting surfers to sections of my websites. For example when I send surfer to script.php?car=bmw it is redirecting surfer to http://www.mywebsite.com/bmw This is how the script looks like: <?php $array = array( "bmw" => "http://www.mywebsite.com/bmw", "toyota" => "http://www.mywebsite.com/toyota", "mercedes" => "http://www.mywebsite.com/mercedes" ); $car =...

.htaccess forcefully hide home page uri

.htaccess,redirect
I have the following .htaccess code: RewriteCond %{HTTP_HOST} ^www\.example\.com$ RewriteRule ^$ subpage [L] So basically if someone visit "www.example.com," he'll see the content of "www.example.com/subpage" without the url changed. This is good. However, they can still visit the page by "www.example.com/subpage." If that happens, I want the url changed back...

Properly use 'next' paramater in URL, Django

python,django,python-2.7,redirect,django-models
Python/Django newbie here. I am using decorator @login_required(login_url='/login/') to 3 different views. I have multiple such views(think services that website offer) which can be accessed only if you are logged in. When I click on service button, the URL formed is something like this: domain/login/?next=/<service_name>/ How do I use the...

Laravel 5 pagination with trailing slash redirect to 301

php,laravel,redirect,pagination,laravel-5
I'm using Laravel 5 and notice that the pagination is adding a trailing slash before the ?page=# and with that, it always redirect to a 301 page. http://example.com/news/articles/?page=2 will do a 301 redirect to http://example.com/news/articles?page=2 This is causing my pagination using ajax to slow down because it is having 2...

redirect_to not working with ajax

ruby-on-rails,ajax,ruby-on-rails-4,redirect
I have created an ajax form in bootstrap modal which creates a new post into my database. The form is: <%= form_for @post, remote:true, :html => {:id => "share-needs-form"} do |f| %> <div class="modal-body"> <div id="shareNeedsModalFirstStep"> <div class="row" style="margin-bottom: 10px"> <ul class="error-alert hidden share-needs-form-errors col-lg-10 col-centered" id="share-needs-error-alerts"></ul> </div> <div class="row"style="margin-bottom:...

Redirecting http to https

apache,.htaccess,redirect,ssl,https
I'd like to redirect all of my http traffic to https, currently in my htaccess file I have the following redirecting my http traffic: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] </IfModule> This redirects all of my non-www to www. What is the best way to...

redirect after 5 seconds but only allow the page to be accessed by the refferer [SOLVED]

javascript,php,.htaccess,redirect
After 16 hours of constant trying and learning as i go along.. im no better off and become over frustrated! So im now in desperate need of help, Any advice or help would be greatly appreciated. I am trying to have page1.php redirect to page2.php after 5 seconds, However page2.php...

An illustration of AWS hosted zones and buckets

redirect,amazon-web-services,amazon-s3,amazon-route53
After more than a few experiments with hosted zones and buckets, it seems I'm getting failures due to unexpired caches even though I may well have set up everything correctly. Before proceeding, I'd like to summarize using two sketches the lengthy (and frankly, tedious) AWS documentation, and ask whether these...

Google Volley Imageloader - Uncache a 302 redirect request or intercepting the redirect url

android,redirect,caching,android-volley,http-status-code-302
I have a set url (ex: http://mywebsite.com/cawn28xd/user_avatar) I call for imageloading that redirects to another link that may or may not be different. I want to be able to either intercept the 302 redirect and grab the url so the imageloader will not cache that specific url (This brings up...

How do I use jQuery to redirect to variable URL?

jquery,variables,url,redirect,button
I'm trying to make a photo gallery for my portfolio. I've hit a wall and can't work out why this won't work: It's a button that sends you to a URL depending on your current URL. In this example, the user is at "/project1.html" and by clicking the next button,...

Mod_rewrite (htaccess) QSA and removing charactes from appended query string

apache,.htaccess,mod-rewrite,redirect,qsa
I've been struggling with some htaccess redirects. I just spent some time reading and searching and couldn't get a solution that works with my scenario. I'm in the process of making the 301 redirect for an old website (ASP) to a new one (Wordpress). The old pages has parameters query...

Links do not redirect to Jquery Tabs

javascript,jquery,redirect,jquery-tabs
I have 4 links as <li><a class="open-tab" href="#sirkethesaptab">Şirket Hesabı</a></li> <li><a class="open-tab" href="#musterihesaptab">Müşteri Hesabı</a></li> <li><a class="open-tab" href="#odemetab">Ödemeler</a></li> <li><a class="open-tab" href="#harcamatab">Harcamalar</a></li> <li><a class="open-tab" href="#personeltab">Personel</a></li> And i have a Jquery tab <div class="col-sm-9...

Devise Redirect After Cancellation

ruby-on-rails,ruby,redirect,devise
I want to redirect customers to a survey after they cancel their subscription, but having a difficult time getting the session destroyed along with the redirecting to the survey. organizations_controller.rb: def cancel if @organization.subscription.cancel redirect_to "http://example.com/contact/cancel?organization=#{@organization.resource_id}" else flash[:error] = "An error has occurred." redirect_to settings_profile_path end end How can I...

Redirecting and rewritting multiple urls with htaccess

php,apache,.htaccess,mod-rewrite,redirect
I am trying to redirect and rewrite the following urls but in some cases I want to preserve some values but hide from the url. Here is the example of what I want to get: I have this URLs: www.mysite.com/?a=blue www.mysite.com/?a=red etc www.mysite.com/?a=orange&b=omega&c=echo&d=zulu www.mysite.com/?a=orange&b=alfa&c=charlie&d=delta etc And I want to get...

How to redirect user to another internal page?

javascript,redirect,parse.com
After creating the record, the user would be redirected to an internal page. "redirect to home.html" I've tried, add the code under "Sucess" but had no success :( How to be redirected after register or log in? window.location.href = "http://stackoverflow.com"; With the above code only works after pressing F5 <script...

To make a particular part of my text clickable

android,redirect,text,clickable
I'm tring to make a particular part of my text clickable. Please see the below image for example: In this image "www.google.com" is placed inside an expandable listview. Can anyone please help me how I can make this text clickable so that it re-directs to its corresponding web page ArrayList<String>...

Redirect all requests, to Base URL without, using .htaccess

ubuntu,redirect,apache2
When I browse example.com/img it shows all the directory contents. This leads to security problem . How to redirect these kind of url requests to example.com but without using htaccess

Plone Archetypes redirection after creation

python,redirect,plone,archetypes
I've searched in Internet for a while, but I haven't found out anything useful... I want to do something as simple as redirect the page to the listing page (folder) after save/create an AT content type. I already know I have to use validate_integrity.cpy and write my redirect's logic there,...

Excluding certain pages from being redirected to https

wordpress,.htaccess,redirect,https,http-redirect
I'm using the following rules on my WordPress website to: Redirect all http pages to https Redirect the careers page to http <IfModule mod_rewrite.c> RewriteEngine On # Go to https if not on careers RewriteCond %{SERVER_PORT} 80 RewriteCond %{REQUEST_URI} !^/careers$ [NC] RewriteRule ^(.*)$ https://www.mywebsite.com/$1 [R,L] # Go to http if...

magento redirect particular category and its subcategory to homepage

.htaccess,magento,redirect
I have one category in magento shop called shop online. I want to redirect this category and its sub category to the home page using the htaceess. Tried this in htaccess to redirect RedirectMatch 301 ^/shop-online/$ http://www.domainname.com/index.php can anyone please help me......

ajax request php class function

url,laravel,redirect
i have content listed in a div and i have a dropdown with various options to order and filter that content. I'm using ajax to filter/order that content and is working but i use other php page with the content i want on the div that has the content, like...

Google analytics not registering my app as a source of traffic to other sites

javascript,ruby-on-rails,redirect,google-analytics,http-referer
I am working on an app which is a essentially an aggregator of links to other websites. However, instead of linking directly to websites, the links on my app point to an endpoint on my app -- /redirect/:uuid, which in turn performs a 301 redirect to the respective sites: User...

fatfree framework, repopulate fields after unsuccesful validation

redirect,contact-form,fat-free-framework
I have GET route which shows the contact form, and POST route when user submits the form, then in my controller method I do some validation tests on data being submitted.. how would I now send user back to form if data is not valid, with entered data being re-populated...

Redirect to edit page automatically if record exists

ruby-on-rails,ruby-on-rails-4,redirect
I want to create a new record if it not exist. Otherwise, redirect to edit page automatically. In case the record exists (e.g: @sale is not nil). However, I got error message: app/views/sales/_form.html.erb where line #1 raised: First argument in form cannot contain nil or be empty Please show place...

Rewrite condition ! being ignored

regex,apache,.htaccess,mod-rewrite,redirect
I'm working on rewrite rules. Every call made to the mobile website should be redirected to the non-mobile version (or in my example, to google) EXCEPT for a few pages. This has to work on several environments but they aren't the issue (asfar as I can see). What I have:...

Why redirect PHP get only white page?

php,redirect
I'm developing in PHP, and I need to change page for different type of user, so I do in this way: switch ($_SESSION['ruolo']) { case 0: header('Location: ./php/admin/homeAdmin.php'); exit(); break; case 1: header('Location: ./php/150ore/home150.php'); exit(); break; case 2: header('Location: ./php/150ore/home150.php'); exit(); break; default: break; } But I obtain only a...

use htaccess to redirect a range of urls which have parameters

.htaccess,mod-rewrite,redirect,parameters,url-rewriting
I had an email subscription for updates on my site, which I've temporarily disabled. I'm seeing hits to the site related to the subscription. The urls are very long but the first several characters are always the same. I've been trying to redirect these (at least for the time being)...

.htaccess file making new domain redirect to my original domain

apache,.htaccess,mod-rewrite,redirect
To give a little background that may help understand this. I only had one domain on my host's server initially. I just added a new domain and it was redirecting to my first site. I had to create an .htaccess file redirect my first site so that it would have...

.htaccess | Too many redirects

apache,.htaccess,mod-rewrite,redirect
I want to add a IP filter into my .htaccess file, but after I applied it, a too many redirects error will show. Content of .htaccess: RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} RewriteCond %{HTTPS} on RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$ RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [L,R=301] RewriteCond %{HTTPS} on RewriteCond %{REMOTE_ADDR} xxx.xxx.xxx.xxx...

Pointing a Sub-domain to a sub directory

php,.htaccess,redirect,laravel-5
Using Laravel I'm generating php pages in to a sub-directory called webpage. I want to allow users to access pages using sub-domain. For example, I've generated a file whoami.php into webpage directory. If people try to access whoami.domain.com, he can see the whoami.php. I've crated an index.php inside webpage which...

How to redirect domain with www or without www

php,.htaccess,mod-rewrite,redirect
I am using the following rewrite rule to redirect domain that has or has not www. RewriteCond %{HTTP_HOST} !^www\.[NC] RewriteCond %{HTTPS}s ^on(s)| RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] It works fine for any sub domain name like www.domainname.com/abc.php or domainname.com/abc.php. But not adding https in case of www.domainname.com or domainname.com. I tried...

Redirecting www to non-www for custom URI

.htaccess,redirect
I want to redirect non-www to www .And Also I am using custom url where domain.com/blablabla.html must show content of url.php .. I use below code and where domain.com/blablabla.html is showing content of url.php but when I access www.domain.com/blablabla.html its redirecting to domain.com/url.php , Instead It must redirect to domain.com/blablabla.html...

Adding headers to 307 redirection

node.js,http,redirect,http-status-code-307
Is it true that you cannot add/modified 307 header except Location? I'm trying to do that in Node.js and seems that newly added header 'X-Atlassian-Token': 'no-check' is not used by the client. res.writeHead(307, { 'Location': 'http://www.mytest.com?os_authType=basic', 'Content-Type': 'multipart/form-data', 'X-Atlassian-Token': 'no-check' }); res.end(); Somebody has asked the same question on Stackoverflow...

PHP - .htaccess and GET parameters

php,regex,.htaccess,mod-rewrite,redirect
I am trying to create a simple redirect to another page on login script. Currently I am rewriting my URLS to the following format using .htaccess: RewriteRule ^login$ ?i=l [L] RewriteRule ^login([^/]*)$ ?i=l&=$1 The normal URL is therefore: domain.com/login - although I wish to be able to do the following:...