super3 / peercoin_website_old

Deprecated.
http://peercoin.net
MIT License
7 stars 46 forks source link

Added URL rewriting for prettier URLs #232

Closed danbartram closed 10 years ago

danbartram commented 10 years ago

Should have fixed the auto-merge failure, sorry about that.

super3 commented 10 years ago

Last time I tried this it didn't work. I followed all the normal tutorials, but I may have not configured something correctly. Let me pull this and see what happens.

danbartram commented 10 years ago

What do you mean it didn't work? Were you getting Server Error 500?

super3 commented 10 years ago

Just pulled. Getting a 404. http://peercoin.net/mining

danbartram commented 10 years ago

Ah, is the ".htaccess" file used?

Try changing the apache2 config value for "AllowOverride" from "none" to "All" ?

super3 commented 10 years ago

Yes. The 301s are working perfectly.

danbartram commented 10 years ago

It is the 301 lines causing the issue. Sorry about this, it was alright my end.

I'll refund the merge tips to the project when they get sent. I'll keep looking into this now.

Sorry about this, I don't know why it's not working properly.

super3 commented 10 years ago

Same thing happened before the 301 lines were added. Something is wrong with the config, but I'm not sure at all what it is.

danbartram commented 10 years ago

If I remove the L flags from the first RewriteRules (NC,L -> NC) they work great, but the 301s still have an issue.

super3 commented 10 years ago

Tried that, but doesn't seem to work on the production server.

danbartram commented 10 years ago

With commenting out the 301 lines? (Make sure your browser isn't caching the 301 and ignoring new server configs)

danbartram commented 10 years ago

I think I finally figured it out.

Using the same rewrite technique was causing an almost redirect loop within the htaccess file.

/mining was pointing to mining.php and then I told mining.php to 301 redirect to /mining and the server was all confused (as was I).

I can't think of an easy fix, other than to just leave the 301 redirects out until we find a solution.

danbartram commented 10 years ago

I've re-donated the tip back so you can see I'm not trying to game more tips, and it felt wrong if my code wasn't working properly.

I'll resbumit another pull that unfortunately won't have the 301 redirects in because I think we'll need to change the system to a router or something to get around that issue.

The 301s aren't even that big an issue, the old pages will still work fine, but the new URLs will slowly replace the .php versions.