Magic Lasso
Magic Lasso

Reputation: 1542

htaccess - all rewrites are being 302 redirected

The relevant parts of the htaccess file are:

Options +SymLinksIfOwnerMatch -MultiViews
RewriteEngine on
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/?services/([^\.]+)/?$ http://www.domain.com/somefolder/web_services/instructions.php?service=$1 [L,QSA]

Visiting a relevant page directly also causes a URL redirect. Ive tried removing all the other rules to check for a double redirect and that did not change anything.

Anybody know what would cause EVERY rewrite to be a 302 redirect?

Upvotes: 1

Views: 19

Answers (1)

anubhava
anubhava

Reputation: 785406

You need to remove http:// from target URI to avoid full redirect:

Options +SymLinksIfOwnerMatch -MultiViews
RewriteEngine on
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/?services/([^.]+)/?$ somefolder/web_services/instructions.php?service=$1 [L,QSA,NC]

Upvotes: 1

Related Questions