Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 08-26-2022, 05:49 AM   #1
Publisher Bucks
Confirmed User
 
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana.
Posts: 773
.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

Quote:
RewriteRule ^link-name$ link.php?id=link-name [L]
RewriteCond %{THE_REQUEST} ^[A-Z][3,9] /link.php?id=243 HTTP/
RewriteRule ^link.php$ https://www.domain.com/links/link? [R=301,L]
I've placed it as .htaccess in the /links/ directory and the domain root and it still kicks out a 500 error.

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
__________________
DMCASUITE
BETA Testers Needed.
Publisher Bucks is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-26-2022, 06:30 AM   #2
k0nr4d
Confirmed User
 
k0nr4d's Avatar
 
Industry Role:
Join Date: Aug 2006
Location: Poland
Posts: 9,217
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
k0nr4d is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-26-2022, 07:21 AM   #3
Publisher Bucks
Confirmed User
 
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana.
Posts: 773
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.
__________________
DMCASUITE
BETA Testers Needed.
Publisher Bucks is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-26-2022, 09:35 AM   #4
ravo
Confirmed User
 
ravo's Avatar
 
Industry Role:
Join Date: Jun 2001
Location: Skype: ravo.fpctraffic
Posts: 5,427
I'm far from an .htaccess expert, but look at;

https://stackoverflow.com/questions/...o-friendly-url
__________________
AdultAdBroker - Buy and Sell Your Flat Rate Banners, Links, Tabs, Pops, Email Clicks and Members' Area Traffic - updated May 2024
ravo is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-26-2022, 09:51 AM   #5
k0nr4d
Confirmed User
 
k0nr4d's Avatar
 
Industry Role:
Join Date: Aug 2006
Location: Poland
Posts: 9,217
Quote:
Originally Posted by Publisher Bucks View Post
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.
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ links.php?id=$1 [QSA,L]
k0nr4d is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-26-2022, 11:07 AM   #6
sarettah
I'll make you famous
 
Industry Role:
Join Date: Oct 2002
Posts: 13,949
Quote:
Originally Posted by Publisher Bucks View Post
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.
That looks bass-ackward to me.

Foe SEO friendly you would have .htacess that rewrites domain/links/link_name to domain/links.php?....

Not the other way around.

.
sarettah is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-26-2022, 12:00 PM   #7
fuzebox
making it rain
 
fuzebox's Avatar
 
Industry Role:
Join Date: Oct 2003
Location: seattle
Posts: 21,859
Quote:
Originally Posted by Publisher Bucks View Post
There’s a ton of sites including Sitepoint threads that say this should work to achieve that.
fuzebox is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-26-2022, 01:24 PM   #8
Publisher Bucks
Confirmed User
 
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana.
Posts: 773
Quote:
Originally Posted by k0nr4d View Post
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ links.php?id=$1 [QSA,L]
k0nr4d,

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 :/
__________________
DMCASUITE
BETA Testers Needed.
Publisher Bucks is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-26-2022, 01:26 PM   #9
Publisher Bucks
Confirmed User
 
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana.
Posts: 773
Quote:
Originally Posted by sarettah View Post
That looks bass-ackward to me.

Foe SEO friendly you would have .htacess that rewrites domain/links/link_name to domain/links.php?....

Not the other way around.

.
I was always under the impression that turning link.php?id=XX to /links/link/-link-name-here/ was a much better option for SEO purposes?
__________________
DMCASUITE
BETA Testers Needed.
Publisher Bucks is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-26-2022, 01:27 PM   #10
Publisher Bucks
Confirmed User
 
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana.
Posts: 773
Quote:
Originally Posted by ravo View Post
I'm far from an .htaccess expert, but look at;

https://stackoverflow.com/questions/...o-friendly-url
Thats actually one of the methods I tried, it works (sort of) but displays the full /root/usr/domain.com/links/link-name-here in the browser.

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 :/
__________________
DMCASUITE
BETA Testers Needed.
Publisher Bucks is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-29-2022, 11:47 AM   #11
zijlstravideo
Confirmed User
 
zijlstravideo's Avatar
 
Industry Role:
Join Date: Sep 2013
Location: The Netherlands
Posts: 805
Quote:
Originally Posted by Publisher Bucks View Post
Thats actually one of the methods I tried, it works (sort of) but displays the full /root/usr/domain.com/links/link-name-here in the browser.

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 :/
But why do you need to take the ID number as a GET query exactly? Why not take the url slug as a query directly? Sounds a lot more straight forward and easier to setup in such way...

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...
__________________
Contact: email
zijlstravideo is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks

Tags
error, directory, /links, domain, root, urls, rewriterule, .htaccess, kicks, click, google, results, helpme, perfectly, kicking, page, load, ^[a-z][3, 9], giving, supposed, re-writing, issue, rewrite, seo, /link.php?id=243



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.