redirect

Domain based redirect to different PHP files via htaccess

Domain based redirect to different PHP files via htaccess Hello there. Here's the thing: I have two domains here [http://www.myproject.com and [http://www.myproject.com.br .. In my root folder i have all the stuff for my projects including two "indexes": "index-en.php" for english and "index.php" for portuguese. Can i have some trick...

Page redirect with successful Ajax request

Hi Everyone, I have a form that uses Ajax for client-side verification. The end of the form is the following: $.ajax({ url: 'mail3.php', type: 'POST', data: 'contactName=' + name + '&contactEmail=' + email + '&spam=' + spam, success: function(result) { //console.log(result); $('#...

.htaccess Redirect on a url with spaces in it

Hello I have a link from anther website that I do not have control of http://domain.com/one two three.exe The correct URL is http://domain.com/one_two_three.exe Note: Underscores instead of spaces. I searched the internet and found this code snippet for .htaccess # Redirect old file path to new file path Redirect /one%20two%20th...

pass variable from one site to another

I'm having difficulty trying to figure this out. I'm not even sure if it's possible.. I will appreciate any sort of help!! On site A, I have a link (an affiliate type link) that redirects to site B. When clicking the link on site A, I use this script to redirect.. header('HTTP/1.1 301 Moved Permanently'); header('Location: ' . $url); ...

301 redirect from top-level domain to index.html in subdirectory

I am working on a small multi-language website. Originally, all of the html files were in the top level directory. Each page has an English version and a Spanish version, which are different html files. I would like to put these files in their own subdirectories, en/ and es/, and then redirect the top-level domain to en/index.html (since...

redirect and send variable via js

This is tricky.. I have two sites. Site A and site B. On another site (any site) I post an affiliate link which takes you to site A where I have a script that redirects to site B (so the first link goes to site B after going through site A) On site A, I have a variable which I'm trying to pass to site B but without putting it in the br...

Header location not working properly

I have a php script that renders an image (with imagick) and saves it to some directory "SITE_ROOT.$filePath", then does a header('Location: ' . SITE_ROOT.$filePath), the file it redirects to is a png image. If I go to the path directly, like just type it in the URL bar I can save the image and everything works fine, however when I rel...

Make curl follow redirects?

I'm trying to make curl follow a redirect but I can't quite get it to work right. I have a string that I want to send as a GET param to a server and get the resulting URL. Example: String = Kobold Vermin Url = www.wowhead.com/search?q=Kobold+Worker If you go to that url it will redirect you to www.wowhead.com/npc=257. I want curl to re...

Redirecting https to http in Magneto with checkout exception (Apache)

Hey Guys, I am using a Magento installation with the one step checkout plugin meanning I have very few pages that need https, I want to control https search indexing and user access by redirecting the whole https version of the site except of course for the secure checkout. the secure checkout section is /onestepcheckout/ (and also inc...

htaccess redirect all pages to single page

Hi I want to redirect all of my old domain request to my new domain using htaccess file. Below is what I am using but it does not work if the page is not on the new site. For example google index about.htm on the old site but on the new site it does not exist. I would like it to just go to the root in all cases. I know this is not idea...

Rendering a View in MVC then immediately redirecting

Hi- What I am trying to do is render a View in an MVC site informing the user to not refresh their browser while server side processing is taking place. This could be a long running task, and if they hit refresh it will send the request again, thus sending them to the error screen when the process was actually successful. I was going t...

301 Redirect from main domain (www and non-www) to subdomain

I need to redirect from a main domain like mydomain.com or www.mydomain.com to sub.mydomain.com - and this needs to work for all requests, so mydomain.com/whatever goes to sub.mydomain.com/whatever. I've tried this, which only works for non-www at the main domain: RewriteCond %{HTTP_HOST} ^mydomain.com [NC] RewriteRule ^(.*)$ http://su...

Header redirect, sessions lost, but only after about 5 minutes

function redirect($url){ header("HTTP/1.1 303 See Other"); header("Location: $url"); exit(); } I have the function called when certain input buttons are clicked. The session is set on every page, and it IS passed if the the button is clicked within 5 minutes. But the session is lost after about 5 minutes if the button is ...

Redirect non www version of domain to www in Jetty

I cannot redirect my non www domain version to www with MovedContextHandler, it does not have host to redirect to. Both www.myhost.com and myhost.com point to my web server IP. When someone tries to open myhost.com he is still able to access my site that way. I want for his browser to receive 301 to www.myhost.com instead. It is importa...

.htaccess: Redirect all requests to a subdirectory except if an exact directory exists

Any request to www.example.com/* must be redirected to www.example.com/blog/* If no www. prefix, add it. Importantly, if there exists any directory matching the request URI, don't redirect. Example: (www.)example.com/<request> -> www.example.com/blog/<request> except <request> === <dirname> Following the above 3 conditions, how do ...

About the syntax of module rewrite

i have some question about the syntax of module rewrite. i would like to know how to write a rule to not include/contain some file? For example: Directories structure: / /home.php /profile.php /pages /pages/index.php /pages/.htaccess About the /pages/index.php content: <?php include_once "../home.php" ?> About the /home.php cont...

c# aspx modal window : how to redirect using javascript to same window (self)

Hello, I have been struggling with a problem that kept me busy for a few days now. I am programming c# .net web applications for an IE only environment and my current project contains a modal window. I hope you guys can help me out here! I have a couple of response.redirects in my modal page that work fine, with the addition of in the...

.htaccess or JavaScript Redirecting

I have a mobile site at m.site.org and the main site at site.org I am using htaccess to redirect other pages but not sure if it's useful in this case. If people are on a mobile phone and they go to the main site I want them to be redirected to the mobile version. Once on the mobile version we have an option to go back to the full site s...

Is there a way to do some sort of regex loop in .htaccess

hi at the minute I have a list of rules in my .htaccess file but if I need to add a new page i then need to edit this file again and add yet another rulles. HEre is a few RewriteRule ^admin/(.*).html$ index.php?x=admin&y=$1 RewriteRule ^admin/project/(.*).html$ index.php?x=work&p=project&$1 RewriteRule ^work/(.*).html$ index.php?x=work&...

Permalink for external links

I would like to use permalink for external links on my site. For example, if I have this link on my site: google.com, it should rewrite to [and show the reader]: mysite.com/go/google Is this possible? Any ideas on how to go about doing this in .htaccess? ...