Menu
  • HOME
  • TAGS

Cannot get wp_redirect to work

wordpress,redirect

You need to get rid of the white space between your closing and opening PHP tags. Because you have this space, WordPress is initiating output before the redirect runs (which isn't allowed). Get rid of the following at the top of your file: ?> <?php so that the top of...

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

c#,asp.net-mvc-4,redirect,mozilla

%E2%80%8B is a URL-encoded, UTF-8 encoded ZERO-WIDTH SPACE character. You likely have one hiding in your application setting file for the ProActiveOffice-URL value. It was maybe pasted in that way, if you copied the URL from somewhere.

htaccess redirect to other domain except for specific request

php,apache,.htaccess,mod-rewrite,redirect

Problem is use of REQUEST_URI variable that changes it's value to index.php in last rule. You need to use THE_REQUEST variable that doesn't get updated. Use this code: RewriteEngine On RewriteCond %{THE_REQUEST} !/intranet [NC] RewriteRule ^ http://google.be [L,R] RewriteRule ^ index.php [L] ...

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

linux,bash,shell,redirect,io-redirection

Fixed output file names are bad news; don't use them. You should probably redesign the processing so that you have a date-stamped file name. Failing that, you should use the mktemp command to create a temporary file, have the command you want executed write to that, and when the command...

python requests with redirection

python,authentication,redirect,curl,python-requests

There is a much simpler way to perform login to this website. import requests headers = { "User-Agent": "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.101 Safari/537.36", } s = requests.session() s.headers.update(headers) # There is a dedicated login page, which is the url of the Login button on...

How to redirect and then stop in node.js

javascript,node.js,redirect,express

You should use middleware. Here's an example: // you can include this function elsewhere; just make sure you have access to it var blockIfLoggedIn = function (req, res, next) { if (req.isAuthenticated()) { req.flash('error', 'Sorry, but you cannot access this page.') return res.redirect('/') } else { return next() } }...

Redirect ranges of IPs in JavaScript (no .htaccess)

javascript,redirect,ip

Use a regular expression instead of an array: var blocklist = /^(10\.20\.30\.40|50\.60\.70\.80|123\.123\.123\..*)$/; if (ip.match(blocklist)) { window.location.replace('http://fakeblock.com/'); } ...

Timeout handle email php

php,email,redirect,location,sleep

Solution for the problem: Cron Job , Good learning.

Redirect to View from AJAX call on error

javascript,jquery,ajax,asp.net-mvc,redirect

Well instead of redirecting in controller you can just send information back to client ajax request and handle redirection here as below: function GetFilteredValuesCallback(values) { var data = JSON.stringify(values); var url = '/Controller/Action'; $.ajax({ type: 'GET', url: url, data: { filter: data }, success: function (result) { if(result.message==="Failed") location.href =...

Laravel 5 redirect after store

php,laravel,redirect,laravel-5,laravel-routing

If you want to redirect to record that was created/updated , you should change: Vehicle::create($input); into: $vehicle = Vehicle::create($input); and now: return redirect('pages/aracislemler'); into return redirect('pages/aracislemler/'.$vehicle->id); ...

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

python,redirect,python-3.x,urllib

In fact, it's a weird problem with ampersands from raw html data. When you visit the webpage and click on link ampersands (&amp) are read by web navigator as "&" and it work. However, python reads data as it is, that is raw data. So: import urllib.request as net from...

use htaccess to redirect a range of urls which have parameters

.htaccess,mod-rewrite,redirect,parameters,url-rewriting

Insert this rule just below RewriteEgine line in your WP .htaccess: RewriteCond %{QUERY_STRING} (^|&)wysija-page=1 [NC] RewriteRule ^ /subscriptions? [L,R=302] ...

PHP - Image Upload , move_uploaded_file not working?

php,redirect,image-uploading

In your code you are missing the closing bracket on your else statement: else { echo "image not uploaded."; } Should be: else { echo "image not uploaded."; } } ...

fatfree framework, repopulate fields after unsuccesful validation

redirect,contact-form,fat-free-framework

I think you can take as a rule to include input data inside your form views. This way, any form view will be easily reusable with any source of data. For example: Your form view: <form action="" method="post"> <input type="text" name="email" value="{{ @@input.email }}"/> <input type="text" name="message" value="{{ @@input.message }}"/>...

htaccess redirect to subdomain based on query string

php,apache,.htaccess,redirect,joomla

You just needed to combine your rules. RewriteCond %{QUERY_STRING} (^|&)option=com_virtuemart(&|$) [NC] RewriteRule (.*) http://parts.domain.com/? [L,NC,R=301] In the second example, you had not provided the regular expression to match....

Get Parameter from URL using PHP

php,url,redirect

You mean like this <?php session_start(); if(isset($_SESSION['postback'])) { if($_GET['postback'] == "") { header ("Location: qualify-step2.php?postback=".$_SESSION['postback']."&city=".$_SESSION['city']); } } ?>...

Devise Redirect After Cancellation

ruby-on-rails,ruby,redirect,devise

Replacing destroy_user_session_path with sign_out_all_scopes(lock=true) (a devise helper) did the trick. def cancel if @organization.subscription.cancel sign_out_all_scopes(lock=true) 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 ...

Rewrite condition ! being ignored

regex,apache,.htaccess,mod-rewrite,redirect

There might be other rules in your .htaccess changing REQUEST_URI to something else and causing negation based condition to pass. Try this instead: RewriteCond %{THE_REQUEST} !/categoryOne RewriteRule ^ http://www.google.be/ [L,R=301] THE_REQUEST variable doesn't change its value after other rules....

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

apache,.htaccess,redirect,rewrite

It's really quite simple: RewriteEngine On RewriteRule ^(static1/static2/static3)/(\d+)/(\d+)(/[0-9a-z-]+)?/?$ /$1/$2 [NC,R=302,L] The expression requires that the IDs be used, and makes the title and trailing slash optional. To make the redirect permanent, change 302 to 301....

HTACCESS 301 redirect issue with strange url variables

wordpress,apache,.htaccess,mod-rewrite,redirect

Try just: RewriteRule ^&force= / [L,NC,R=301] ...

Magento 1.8.0.0 - Worldpay payment response receiving 301 error

php,magento,redirect,response,worldpay

If anyone was wondering, we fixed this by upgrading the installation from 1.8.0.0 to the latest Magento 1.9.1.1 with all security patches.

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

javascript,php,.htaccess,redirect

You can use session data to make sure users of page2 have passed through page 1 With the way sessions work,The encrypted string is quite secure even if it is not encrypted at all. on page1: session_start(); $_SESSION['secret_key'] = 'encrypted_string'; on page2: session_start(); if($_SESSION['secret_key'] == 'encrypted_string'){ // user is authorized...

.htaccess rewrite - redirect pages

apache,.htaccess,mod-rewrite,redirect,rewrite

You can use this code in your DOCUMENT_ROOT/.htaccess file: Options -Indexes +FollowSymLinks RewriteEngine On RewriteBase / RewriteCond %{HTTPS} off RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{THE_REQUEST} !/search/ [NC] RewriteRule ^(.*)$ search/$1 [L,R] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f <IfModule mod_php5.c> RewriteRule ^(.*)$ index.php/$1 [L] </IfModule>...

How to remove subdirectory using rewriterule with non-www redirection

regex,apache,.htaccess,mod-rewrite,redirect

You can use an OR condition in conditions: Options +FollowSymlinks RewriteEngine On RewriteCond %{HTTP_HOST} ^www\. [NC,OR] RewriteCond %{THE_REQUEST} /subdir/ [NC] RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC] RewriteRule ^(?:subdir/)?(.*)$ http://%1/$1 [NC,R=302,L] ...

An illustration of AWS hosted zones and buckets

redirect,amazon-web-services,amazon-s3,amazon-route53

I would recommend: In Amazon S3, create a bucket named mysite.com In Amazon Route 53, create a Hosted Zone for mysite.com (and of course, purchase the domain name, or point the current domain name to Route 53) In Route 53, create an A Record for the apex of mysite.com using...

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

javascript,ios,redirect,apple

Solution: don't use the "?mt=8" parameter in the iOS-Appstore-Link and the redirect will work (and open the Appstore-App on your device)

mod_rewrite - force redirecting to rewritten URL

apache,.htaccess,mod-rewrite,redirect

You need a new rule for that redirect: Options +FollowSymLinks -MultiViews RewriteEngine On RewriteBase / RewriteCond %{THE_REQUEST} /(?:index\.php)?\?search=([^\s&]+) [NC] RewriteRule ^ search/%1? [R=302,L,NE] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^search/(.*)$ /?search=$1 [L,QSA] ...

redirect_to not working with ajax

ruby-on-rails,ajax,ruby-on-rails-4,redirect

Actually, you are sending js request. Therefore, server sent you response in js format. For this, you have to write format of response in create method, as following. def create @post = Post.new(post_params) respond_to do |format| if @post.save format.html { redirect_to @post } format.js else format.html { render :new }...

Magento Redirect all .htaccess keeping administration

apache,.htaccess,redirect

Maybe you can try your .htaccess this way. RewriteEngine On RewriteCond %{REQUEST_URI} ^/index\.php/admin [NC] RewriteRule ^ - [L] RewriteCond %{THE_REQUEST} !/new/ [NC] RewriteRule !^new/ /new%{REQUEST_URI} [NC,R=301,L] ...

Redirecting www to non-www for custom URI

.htaccess,redirect

Flip the order of your rules otherwise last rules only works on converted URI: RewriteEngine On RewriteCond %{HTTP_HOST} !^domain\.com$ [NC] RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-l RewriteRule ^[^/.]+\.html$ /url.php [L,NC] Don't forget to clear your browser cache before testing this....

PHP - .htaccess and GET parameters

php,regex,.htaccess,mod-rewrite,redirect

Try these rules: RewriteRule ^login/?$ ?i=l [L,QSA] RewriteRule ^login(&[^/]+)/?$ ?i=l$1 [L,NC] Though I suggest using: domain.com/login?redirect=/account/settings and get rid of 2nd rule altogether. QSA flag in first rule will add redirect=/account/settings query parameter as $_GET to your php file....

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

apache,.htaccess,mod-rewrite,redirect

This should work in your .htaccess file on example.com. RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^/]+)/?$ http://example2.com/$1 [R=302,L] Change to R=301 when you confirm it's working. ...

.htaccess allow image to display directly

php,regex,apache,.htaccess,redirect

Add conditions before your rule to skip image/css/js filesdirectories: RewriteEngine On RewriteRule !\.(?:jpe?g|gif|bmp|png|tiff|css|js)$ index.php [L,NC] ...

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

regex,wordpress,.htaccess,mod-rewrite,redirect

The way you are trying to capture substrings and inject them into the substitution string is totally wrong. Try this: RewriteRule ^([A-Za-z0-9\-]+)/([A-Za-z0-9\-]+)/(\d*)/?$ http://localhost/ats-new/$1/$2-$3 [R=301,NC,L] ...

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

.htaccess,redirect,mobile

You need to check the mobile redirect first, and you need to include the request URI. <IfModule mod_rewrite.c> RewriteEngine on # Redirect mobile requests to the mobile site # (but don't redirect when accessing certain directories) RewriteCond %{REQUEST_URI} !^/images [NC] RewriteCond %{HTTP_USER_AGENT} "android|blackberry|googlebot-mobile|iemobile|ipad|iphone|ipod|opera mobile|palmos|webos" [NC] RewriteRule ^(.*)$ http://m.domain.com/$1 [R=302,L] #...

Redirecting and rewritting multiple urls with htaccess

php,apache,.htaccess,mod-rewrite,redirect

I have resolved my problem migrating my "spaghetti code" to a Laravel framework, and using the file routes.php to pass the variables and blade templates for minimizing the use of this variables.

Redirect URLs using Redirect component or htacess

php,.htaccess,redirect,joomla

Add redirect flag RewriteEngine On RewriteCond %{HTTP_HOST} ^www.portal-gestao.com RewriteRule ^component/k2/(.*)$ https://www.portal-gestao.com/item/$1 [R=301,L] ...

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

.htaccess,redirect,https,subfolder,no-www

Inside /webapp/.htaccess use this rule: RewriteEngine On RewriteCond %{HTTPS} off [OR] RewriteCond %{HTTP_HOST} ^www\. [NC] RewriteRule ^ https://domain.com/%{REQUEST_URI} [R=301,L,NE] ...

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

javascript,ruby-on-rails,redirect,google-analytics,http-referer

RFC does not specify a behavior for the Referrer header after a 301, however your problem is about protocols, you are being redirect from a secure HTTPS connection. The browser will not send any referrer because this could harm the client security exposing informations about the previous request. A simple...

Mod Rewrite Maintenance page that uses multiple URLs

windows,.htaccess,redirect,isapi-rewrite

You need to check HTTP_HOST in your condition to check for the domain and then redirect based on that. RewriteEngine On RewriteCond %{HTTP_HOST} ^(www\.)?foo\.bar [NC] RewriteCond %{REMOTE_ADDR} !^123\.456\.789\.000 RewriteCond %{REQUEST_URI} !/maintWWW.html$ [NC] RewriteCond %{REQUEST_URI} !\.(jpe?g?|png|gif) [NC] RewriteRule .* /maintWWW.html [R=302,L] RewriteCond %{HTTP_HOST} ^(www\.)?bar\.foo [NC] RewriteCond %{REMOTE_ADDR} !^123\.456\.789\.000 RewriteCond %{REQUEST_URI} !/maintWWW2.html$...

.htaccess | Too many redirects

apache,.htaccess,mod-rewrite,redirect

I'm assuming that you are trying to do two things here: Force HTTPS and www. Redirect to test.php if a certain IP is making the request The issue you were facing was due to the fact that even though the IP address was being matched, it was still being checked...

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

regex,apache,.htaccess,mod-rewrite,redirect

Don't mix mod_alias rules and mod_rewrite one as they both get invoked at different times by Apache. Try this in your .htaccess: RewriteEngine On RewriteRule ^1\.html$ /folder/1 [R=301,L,NC] RewriteRule ^2\.html$ /2 [R=301,L,NC] RewriteRule ^3\.html$ /3 [R=301,L,NC] RewriteRule ^3/?$ /vw-vans/another-folder/2 [R=301,L,NC] # catchall rule for .html files RewriteRule ^.+?\.html$ /folder? [R=301,L,NC]...

Laravel 5 pagination with trailing slash redirect to 301

php,laravel,redirect,pagination,laravel-5

If you look in your app/public/.htaccess file you will see this line: # Redirect Trailing Slashes... RewriteRule ^(.*)/$ /$1 [L,R=301] By removing it you will disable trailing slash redirect....

Redirect 301 with wordpress articles from a domain to another

wordpress,.htaccess,redirect

You can use mod_rewrite for this: RewriteEngine On RewriteRule ^(\d+)/(\d+)/(\d+)/([\w\-]+)/?$ http://www.newdomain.com/$1/$2/$3/$4/ [R=302,NC,L] If you are happy with the redirect, and would like to make it permanent, you can change 302 to 301....

Redirect files from Popen to subdirecotry

python,redirect,subprocess,stdout,popen

If you can't change the output filenames e.g., by passing them as a parameter to the subprocess or by specifying the output directory as a parameter then try to run the subprocesses in a different directory: from subprocess import check_call check_call(args, cwd="subdir") Make sure that args use absolute paths so...

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

ubuntu,redirect,apache2

Best practice usually suggests adding these lines to your Apache config to disable directory listing: <Directory /> Options -Indexes Order allow,deny Allow from all </Directory> But this will simply deny users access to the URL example.com/img. If you'd like to redirect as well, you could add an index.php file to...

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

javascript,redirect

This is not possible since the browser does not pass the fragment part to the server meanwhile only the server can do 301 redirects. I'd suggest you to keep the current website URL for this specific case if you need to keep old hyperlinks working....

Redirect to edit page automatically if record exists

ruby-on-rails,ruby-on-rails-4,redirect

A redirect is a fresh request to Rails. You need to set @sale again in the edit action as it is not persisted from update. Alternatively, you can render the edit view directly from update if the update fails. That will preserve the instance variables from update....

Redirecting http to https

apache,.htaccess,redirect,ssl,https

You can use this in your .htaccess file. Just replace example.com with your domain and all bases should be covered. IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_HOST} !^www\. [NC,OR] RewriteCond %{HTTPS} !^on RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L] </IfModule> ...

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? No, it's not true. Running your code shows a response including both the specified status code and the extra headers: HTTP/1.1 307 Temporary Redirect Location: http://www.mytest.com?os_authType=basic Content-Type: multipart/form-data X-Atlassian-Token: no-check Date: Sat, 06 Jun 2015 13:40:41 GMT Connection:...

How to redirect user to another internal page?

javascript,redirect,parse.com

You could start by changing sucess to success then try window.location = "http://www.yoururl.com"; or window.location.href = "whatever" or window.location.replace("http://www.yoururl.com/"); Then well you could add a return to it. And if it doesn't still work? Try using a setTimeout....

301 Redirect entire site to new site using .htaccess file

.htaccess,mod-rewrite,redirect,http-status-code-301,http-redirect

You can get rid of all the code in your .htaccess and use this rule instead: RewriteEngine on RewriteRule ^ http://siteTWO.co.uk/? [R=301,L,NE] Make sure to clear your browser cache before testing this....

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

You can use this code in your DOCUMENT_ROOT/.htaccess file: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{QUERY_STRING} !(^|&)dev=1(&|$) [NC] RewriteRule !^maintenance\.html$ maintenance.html [L,NC] Key is use of query parameter dev=1. Without this query parameter site will show maintenance.html. But if you add ?dev=1 to your URL then you...

magento redirect particular category and its subcategory to homepage

.htaccess,magento,redirect

In Magento, it's wrong to do redirects in .htaccess, but most newbies still solve the issue this way.... Your problem is that category urls in Magento usually have .html extension, so try this: RedirectMatch 301 ^/shop-online.html$ http://www.domainname.com/index.php The correct way is to create a url rewrite. In the admin, go...

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

.htaccess,mod-rewrite,redirect,url-rewriting,file-extension

You can use: RewriteEngine On RewriteCond %{THE_REQUEST} /index [NC] RewriteRule ^(.*?)index(?:\.html)?$ /$1 [L,R=301,NC] RewriteCond %{REQUEST_FILENAME} !-d RewriteRule (.*)/index$ $1/ [R=301,L,NC] RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.+?)/$ $1 [R=301,L] ...

Htaccess: HTTPS redirection on page + sub pages

apache,.htaccess,mod-rewrite,redirect,https

# HTTPS page Redirects RewriteEngine On # This will enable the Rewrite capabilities RewriteCond %{HTTPS} !=on # This checks to make sure the connection is not already HTTPS RewriteRule ^/?enrolments/(.*) https://%{SERVER_NAME}/enrolments/$1 [R,L] #END https redirects ...

RewritePath doesn't change browser URL

asp.net-mvc,redirect

That's how RewritePath works, it doesn't change the URL in the browser address bar and it's usually used when the old URL is more user friendly than the new URL. If you also want to change the URL in the browser address bar, you can try HttpContext.Current.Response.Redirect("/newControler/newAction"); or this if...

301 Redirect Regex Pattern - Sitecore Redirect module

regex,redirect,sitecore,url-redirection

This will fit your "less global" requirement. var pattern = @"^(https?://[^/]*/some-path/videos/)\d{4}/\d{2}/\d{2}/\d{2}/\d{2}/(.*)$"; var match = Regex.Match(myurl, pattern, RegexOptions.IgnoreCase); var rewrittenUrl = string.Empty; if (match.Success) { rewrittenUrl = match.Groups[1].Value + match.Groups[2].Value; } Note that I chose to ignore case. This is probably correct behavior given that you are dealing with URLs. I...

Redirect to a homepage cakephp 3

php,redirect,routes,cakephp-3.0

Looks like that "license header" line is supposed to be a comment, but is not within <?php ?> tags and hence is being taken as output. If that's the case, the fact that some output has been generated already will stop the redirect from happening.

Redirect all subdirectory links to another subdirectory

wordpress,apache,.htaccess,redirect,joomla

Insert this rule as the first rule just below RewriteEngine line in root .htaccess: RewriteRule ^(\d{4}/\d{2}/.+)$ /blog/$1 [L,NC,R=301] ...

Force WWW when URL contains path using .htaccess

.htaccess,session,url,redirect

It seems to look ok but one thing you should do is always put your other rules before the wordpress rules as a habit. When using wordpress it should generally be the last set of rules since it does all the routing. Now for the redirect, you should probably use...

Excluding certain pages from being redirected to https

wordpress,.htaccess,redirect,https,http-redirect

Try using THE_REQUEST instead of REQUEST_URI: <IfModule mod_rewrite.c> RewriteEngine On # Go to https if not on careers RewriteCond %{SERVER_PORT} =80 RewriteCond %{THE_REQUEST} !/careers/[\s?] [NC] RewriteRule ^(.*)$ https://www.mywebsite.com/$1 [R,L] # Go to http if you are on careers RewriteCond %{SERVER_PORT} !=80 RewriteCond %{THE_REQUEST} /careers/[\s?] [NC] RewriteRule ^(.*)$ http://www.mywebsite.com/$1 [R,L] </IfModule>...

Naked Root Domain Hosting

redirect,amazon-web-services,amazon-s3,amazon-route53

Set up the bucket, named for your domain name. The bucket name has to match exactly the address that shows in the browser's address bar. Then, create an A record at the root (apex) of the domain in Route 53, leaving the hostname empty, selecting "Yes" for Alias, then select...

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 only focused on protected_page.php since you don't want it to be accessed using direct link. <?php include_once 'includes/db_connect.php'; include_once 'includes/functions.php'; sec_session_start(); if(!isset($_SESSION['username'])) { header("Location: index.php"); } ?> <?php if (login_check($mysqli) == true) : ?> </h2> <p>Welcome <?php echo htmlentities($_SESSION['username']); ?>!</p> <p>Return to <a href="index.php">login page</a></p> <?php else : ?>...

How to redirect domain with www or without www

php,.htaccess,mod-rewrite,redirect

Just use this. Replace example.com with your domain. RewriteEngine on RewriteCond %{HTTP_HOST} ^example\.com [NC,OR] RewriteCond %{HTTPS} !^on RewriteRule ^ https://www.example.com%{REQUEST_URI} [R=301,L] ...

HttpResponseRedirect creates invalid redirect URL

python,django,.htaccess,python-2.7,redirect

Add a slash before your path to use absolute url. Django here is trying to use relative path. Which end up in the same endpoint in your application, and loop again. return HttpResponseRedirect('/appname/index.html',{'form':form,'expire':True}) ...

Htaccess regex: exclude REQUEST_URI

regex,apache,.htaccess,mod-rewrite,redirect

Try this rule instead: RewriteCond %{HTTP_HOST} ^sub\.example\.com$ [NC] RewriteCond %{THE_REQUEST} !\s/+(aaa|bbb|ccc)/ [NC] RewriteRule . http://www.example.com%{REQUEST_URI} [R=301,L,NE] Test it after clearing your browser cache. Using THE_REQUEST instead of REQUEST_URI to make sure we use unchanged URI values as received by Apache....

Properly use 'next' paramater in URL, Django

python,django,python-2.7,redirect,django-models

Inside your login view, just do this: def login(request): """ Check for login and store the result in login_successful """ path = request.GET.get("next") if login_successful: if path: return HttpResponseRedirect(path) else: return HttpResponseRedirect(your_earlier_path) ...

Nginx redirect http subdomains to https

ubuntu,redirect,ssl,nginx,rewrite

Your web server is setup with Strict-Transport-Security max-age=16070400; includeSubdomains. This will tell the web browser to request your domain using https only. If you want the subdomain blog to be accessed through insecure http, you will need to remove includeSubdomains from the HTTP Strict Transport Security (HSTS) and use a...

Apache htaccess redirect file

php,regex,apache,.htaccess,redirect

Try this simplified rule: RewriteEngine On RewriteRule ^aaa/(bbb/ccc/.*)$ http://newwebsite.com/$1 [R=301,L,NC] Make sure to clear your browser cache before testing....

PHP redirect page works only in localhost

php,mysql,forms,redirect

<?php require_once('Connections/db.php'); ?> <?php if (isset($_POST['submit'])) { Change your above code to <?php require_once('Connections/db.php'); if (isset($_POST['submit'])) { and also remove the last ?> if you do not have html after that. After that, it should work. To turn on Error Reporting, place ini_set('display_errors',1); error_reporting(E_ALL); at the beginning of your php...

Redirect stdout using exec in subscript

linux,bash,redirect,command-line,sh

Solution based on the comment from "Zaboj Campula": if /bin/grep -q "^[[:space:]]/usr/bin/enigma2_pre_start.sh$" /var/bin/enigma2.sh then echo Unpatched > /tmp/enigma.sh /bin/sed -e 's/^\t\(\/usr\/bin\/enigma2_pre_start.sh\)$/\t\. \1/g' /var/bin/enigma2.sh -i pid=`/bin/ps -o ppid= $$` && /bin/kill $pid fi ...

htaccess rewrite rule is not working

php,apache,.htaccess,mod-rewrite,redirect

Try this in your root .htaccess: Options +FollowSymlinks -MultiViews RewriteEngine on RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^ - [L] RewriteRule ^post/(.+)$ post.php?tag=$1 [L,NC,QSA] RewriteRule ^search/(.+)$ search.php?tag=$1 [L,NC,QSA] ...

Redirect without changing Url htaccess

php,.htaccess,redirect

You should be able to use this code here. RewriteEngine on #ignore App1 and App2 and interally Rewrite to /App RewriteCond %{REQUEST_URI} !(App1|App2) [NC] RewriteRule ^(.*)$ /App/$1 [L] ...

Grails: Carry forward params on hyperlink is clicked

grails,redirect,controller

If you look to the redirected URL, you will realize that params are carry forwarded correctly. 11 the only params you have in your delete action and that is forwarded to list action (.../list/11) after successful delete. The issue is that you are not passing max and offset with delete...

Redirect specific Url variables

php,.htaccess,mod-rewrite,redirect

Try this : RewriteEngine On RewriteCond %{QUERY_STRING} ^s=([^&]+)&type=([^&]+) [NC] RewriteRule ^data.php$ /d.php?s=%1&t=%2 [NC,R,L] This will externally redirect a request for : /data.php?s=foo&type=bar to /d.php?s=foo&t=bar ...

.htaccess forcefully hide home page uri

.htaccess,redirect

You need an additional rule that matches against the actual request and not the URI. Since the rewrite engine loops, the URI keeps changing, so you need to match against the %{THE_REQUEST} variable. You need this rule before the rule that you have in your question: RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]...

Redirect based on operating system

javascript,wordpress,redirect,user-agent

Use user agent instead, because appVersion is deprecated. function detectOS(){ if (navigator.userAgent.indexOf("Win")!=-1) return "Windows"; if (navigator.userAgent.indexOf("Mac")!=-1) return "MacOS"; if (navigator.userAgent.indexOf("Linux")!=-1) return "Linux"; if (navigator.userAgent.indexOf("OpenBSD")!=-1) return "OpenBSD"; if (navigator.userAgent.indexOf("FreeBSD")!=-1) return "FreeBSD"; if (navigator.userAgent.indexOf("NetBSD")!=-1) return "NetBSD"; return undefined; } ...

Why redirect PHP get only white page?

php,redirect

In order to debug this, there are a couple of things to do: ini_set('error_reporting', E_ALL); ini_set('display_errors', 1); 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: var_dump("I'm the default case!"); //If you get this, then your session...

Plone Archetypes redirection after creation

python,redirect,plone,archetypes

Your *.metadata file might be missing or have an action that routes to a different location than you expect: http://docs.plone.org/old-reference-manuals/forms/using_cmfformcontroller.html The default metadata for content_edit lives in Products/Archetypes/skins/archetypes/content_edit.cpy.metadata: ... [actions] action.success = traverse_to:string:validate_integrity action.success_add_reference = redirect_to:python:object.REQUEST['last_referer'] action.failure = traverse_to_action:string:edit action.next_schemata =...

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

python,django,redirect,django-generic-views

Well, I finally found a work-around. I just set up the redirect to follow the template-style reverse path. def dispatch(self, request, *args, **kwargs): return redirect('purchases:Roger Rabbit') That seems to do the trick. I went wrong by misreading the following excerpt in the docs: def my_view(request): ... return redirect('some-view-name', foo='bar') In...

Links do not redirect to Jquery Tabs

javascript,jquery,redirect,jquery-tabs

So, it's a silly mistake I guess as you have a missing # in your selector within the .open-tab click function. $('.open-tab').click(function (event) { var tab = $(this).attr('href'); alert(tab); $('#tab-container2').tabs('select', tab); // <- added # }); -Demo- Note: The select option has been removed from jQuery UI v1.10+. You must...

C# mvc4 - direct URL to controller

c#,asp.net-mvc-4,url,redirect

You might have forgotten to specify name of the controller in Html.ActionLink() parameter. Try Html.ActionLink("actionname","controllername");

.htaccess file making new domain redirect to my original domain

apache,.htaccess,mod-rewrite,redirect

Why not just exclude the new site, if I am understanding correctly? RewriteEngine On RewriteCond %{HTTP_HOST} !^(www\.)?newsite\.com [NC] RewriteCond %{HTTP_HOST} ^www\.oldsite\.com [NC] RewriteRule ^(.*)$ https://oldsite.com/$1 [R=301,NE,L] RewriteCond %{HTTPS} ^off RewriteCond %{HTTP_HOST} !^(www\.)?newsite\.com [NC] RewriteRule ^(.*) https://oldsite.com/$1 [R=301,NE,L] Alternatively maybe you can just tell it to not do anything based on...

Redirect to random link from array

php,redirect

You need to use multi-dimensional array and array_rand() function. Try considering the code below: $array = array( "bmw" => array("http://www.mywebsite.com/bmw/x1","http://www.mywebsite.com/bmw/x3","http://www.mywebsite.com/bmw/x5"), "toyota" => array("http://www.mywebsite.com/toyota/yaris", "http://www.mywebsite.com/toyota/avensis", "http://www.mywebsite.com/toyota/corolla"), "mercedes" => array("http://www.mywebsite.com/mercedes/e", "http://www.mywebsite.com/mercedes/s", "http://www.mywebsite.com/mercedes/d") );...

Rewrite Problen .htaccess Redirect 301

php,apache,.htaccess,mod-rewrite,redirect

From the mod_alias/Redirect documentation: Additional path information beyond the matched URL-Path will be appended to the target URL. "Additional path information" is somewhat vague, but I assume they are referring to the url parameter. Now, this should not affect functionality at all, so again I assume that you just don't...

To make a particular part of my text clickable

android,redirect,text,clickable

Try and include the following in the TextView definition in XML file: <TextView ... android:autoLink="web"/> The docs of android:autoLink say: Controls whether links such as urls and email addresses are automatically found and converted to clickable links So for automatically finding links, the above may help. Try and see....

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

.htaccess,mod-rewrite,redirect

Add question sign after to remove query string RewriteRule ^news/news\.php$ /posts/vanity-url.php? [L,R=301] ...

Redirect htaccess automatic

.htaccess,redirect,website

try this RewriteRule "^beta\/(.+)" "http://miosito.ext/$1" [R,L] Reference for Rewriting URL: http://httpd.apache.org/docs/2.4/rewrite/remapping.html...

Pointing a Sub-domain to a sub directory

php,.htaccess,redirect,laravel-5

I got a every simple solution. As I'm using Laravel and that already use an index.php as bootstrap, I wrote some PHP codes there to achieve my goal. You guys can use if needed. And please advice me if my solution isn't good enough. Thanks My Solution $link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";...