![]() |
.htaccess rewrite issue
Can anyone who knows about .htaccess tell me why this is giving me a 500 error?
Its supposed to be re-writing the URLs so they are SEO friendly :Oh crap Quote:
When its in the /links/ directory it gives me an error when I click on one of the urls. When its in the domain root it wont even load the page before kicking out a 500 error. According to several Google results, this *should* be working perfectly :helpme |
That's all so wrong that I don't even know where to start, because I can't figure out what it is you are trying to do from looking at those 3 lines
|
It’s supposed to rewrite from link.php?id=XX
To /links/some-link-name There’s a ton of sites including Sitepoint threads that say this should work to achieve that. |
I'm far from an .htaccess expert, but look at;
https://stackoverflow.com/questions/...o-friendly-url |
Quote:
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ links.php?id=$1 [QSA,L] |
Quote:
Foe SEO friendly you would have .htacess that rewrites domain/links/link_name to domain/links.php?.... Not the other way around. . |
Quote:
|
Quote:
That doesnt do anything when I put it in .htaccess, I was using that originally, then did a search for alternate ways to achieve what I wanted to happen :/ |
Quote:
|
Quote:
When editing the rewrite slightly, the most I could get it to do was /links/link/32 (link id number not the title of the link itself). It also just redirects to my 404 catchall pages content, not the link ids page content :/ |
Quote:
For example, just make "domain.com/links.php?id=big-boobies" redirect to "domain.com/links/link/big-boobies". You can skip the whole ID thing, you can get the matching ID number using the slug as well (just look it up from your database). Or make it work with both the slug and the ID number as query... then let your php code do the magic. If the GET parameter is an integer, connect to your database, find the matching slug first and then go ahead and force redirect to domain.com/links/rick-james-bitch... |
All times are GMT -7. The time now is 12:25 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc