super3 / peercoin_website_old

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

Removed PHP extension from URLs #237

Closed danbartram closed 10 years ago

danbartram commented 10 years ago

This commit works fine, i.e. no errors and routes everything properly.

Unfortunately, without using something a PHP router, I don't think we'll be able to use the 301 redirect technique.

If that's something you want to do, we can look into it. Otherwise, I don't think the 301s will be that important anyway. The old *.php extension URLs will still work perfectly, but now the pages point to the URLs without the extension, meaning the *.php will slowly be replaced in page rank by the new form.

I refunded the last commit tip because it didn't work and it felt wrong to me to get paid for a bad contribution, tx: https://blockchain.info/tx/955d9ed2a1469fcb8f0b9a9240d193e1292590380840c3cf177d6a9b194c8e6c

Hopefully this one works just as well as the last one I intended to.

super3 commented 10 years ago

Thanks for that. Yeah I sent my fluff commits trying to get this working to the dev fund. Let me merge this and see what happens.

danbartram commented 10 years ago

It's still playing up, but it worked perfectly on my test system, I don't get this.

Is it something to do with the relative pathing?

RewriteRule ^mining$ mining.php [NC]

Is the mining.php being looked for in the wrong directory for some reason? Does it need absolute pathing - that's the only thing I can think of right now.

Edit: 19:00 - Whatever you just did worked! It's finally working! Do you know what the issue was?

super3 commented 10 years ago

Took forever, but I found an article that helped. Looking through the errors logs I found this:

 [Thu Jun 23 16:55:06 2011] [error] [client 127.0.0.1] Negotiation: discovered file(s) matching request: /Sites/something.com/users (None could be negotiated).

Which led me to this article.

Basically I just removed MultiViews from my sites-available Apache config and everything started working.

danbartram commented 10 years ago

Aha! Glad you managed to find the issue.

It's totally up to you if you want to play with the commit history anymore, but maybe this was also the issue with the 301 redirects I submitted earlier?

super3 commented 10 years ago

Yes, I believe this was the issue the whole time.

On Fri, Feb 21, 2014 at 2:04 PM, Dan Bartram notifications@github.comwrote:

Aha! Glad you managed to find the issue.

It's totally up to you if you want to play with the commit history anymore, but maybe this was also the issue with the 301 redirects I submitted earlier?

Reply to this email directly or view it on GitHubhttps://github.com/super3/peercoin.net/pull/237#issuecomment-35761982 .

Shawn Wilkinson Bitcoin Developer/Entrepreneur/Enthusiast (1P4QkLsujBPBZyUwDezikL4fUSs7JvFhPv) me@super3.org http://super3.org

danbartram commented 10 years ago

It looks like it might have been. Annoying, but at least found the issue.

Are you cool to re-add the Redirect lines to .htaccess? Or do you want it as a pull request, or are you going to try and play with the git commit history to roll it back in?

super3 commented 10 years ago

Yeah, go ahead and do the 301s. No need repeating history.

super3 commented 10 years ago

Also can you add what I said above for the fix in the README.md under deploying.

danbartram commented 10 years ago

Sure, how's this?


Deploy

URL Rewriting via Apache's mod_rewrite module has issues when the MultiViews option is set in any of the config files in the sites-available directory. Ensure this option is removed from your site's config files or errors will occur with URL rewriting (/mining.php -> /mining)

We run the deploy.sh every 10 minutes ...

super3 commented 10 years ago

+1

danbartram commented 10 years ago

Awesome, sent as pull #239.