PHP - .htaccess 301 redirect clearing get and post variables
Search
Tag Search
car
301 redirect
subdomain
art
disable cache
flash
regular expressions
print design
plugin
javascript
client-side
html
regex
php
jquery
apache
AJAX
seo
hand drawing
action script
cache
svn
bugs
thickbox
htaccess
Recently Added
- HTML [3 items]
- SVN (Subversion) [3 items]
- jQuery [10 items]
- PHP [4 items]
Most Popular
- jQuery [10 items]
- PHP [4 items]
- SVN (Subversion) [3 items]
- HTML [3 items]
Member Options
01
Sep
Created by: robilim - Date Added: 1st September 2009 - 0 Responses
Just an issue I have come across recently on my website, so I thought I could share my problem and the resolution.
Problem:
Member's login was not working after I added the following .htaccess lines of code to redirect non-www address to www address:
RewriteEngine On
Options +FollowSymLinks
RewriteBase /
RewriteCond %{http_host} ^siteurl.com [nc]
RewriteRule ^(.*)$ http://www.siteurl.com/$1 [R=301,nc]
This was put in place for better performance in search engines by having only one version of the same page.
My server name defaults to the non-www address which when the redirect runs while trying to login, the POST variables are cleared completely. Therefore the users are unable to login because there was apparently no form data sent.
Solution:
Rather than letting the redirect actually occurring, I made the form action go to the absolute path of the www address.

