Jump to content

URL forwarding and RewriteRule causes "page not found" error

Recommended Posts

Hi there,

im not sure if this is realy a processwire specific problem - but the site runs on a processwire installtion - and im not sure.
I have a site lets call it www.my-pw-site.com and a TLD lets call it www.external.tld which forwards to www.my-pw-site.com.
What i try to do is to load a subpage of www.my-pw-site.com if the request comes from www.external.tld.
So i tried to write a RewriteCond & RewriteRule in the .htaccess 

RewriteCond %{HTTP_HOST} ^external\.tld$ [OR]
RewriteCond %{HTTP_HOST} ^www\.external\.tld$ [NC]
RewriteRule ^(.*)$  http://www.my-pw-site.com/subpage/ [R=301,L]

And this is working for me an also other people - but my client gets a "page not found" error.
They did send me screenshots and there i can see that the url in the adressbar changed correctly.
But the error message maintains. Does anybody maybe have an idea what can cause such behaviour?

Thanks in advance
Best Simon

Share this post

Link to post
Share on other sites

You probably shouldn't change ProcessWire's .htaccess file at all for this kind of redirect.

Easiest fix: change the external.tld redirect itself and add that subpage URL.


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...