Mod Rewrite pagination

Yes it should. But for whatever reason, it is performing some weird processing. It only happens with page/2 though… not page/2/ (note: ending slash)

Should I just stick to a specific naming scheme then? I don’t mind including the / apposed to not. Just let me know which I should be doing. I assume I should stick to page/2/ instead of page/2?

You need to get rid of the redirection. That is, delete R=301.

@RR - yes, move to a good host. There is no reason for a host to leave a problem on the server.

@J_M - the R=301 is to show the redirection. Since RR is in testing, that’s the smart thing to do (then remove the R=301 as stated a couple times above for the production environment).

It seems like there is some caching going on here…

As even after removing the R=301, I find myself being redirected when accessing the links in my prior post. However, if I visit page 88 for example, it doesn’t redirect.

Caching confirmed. If I visit the above links using Incognito mode, they all work as expected.

Yeah, 301 is a permanent redirect, so browsers will cache it.

There you go Ryan. At one point when you redirected with 301, you had an error that put the path in your redirect. That got cached which explains why /page/2 doesn’t work and /page/2/ does work.

Clear your cache and you should be all set.

I did just c lear my cache but archives.php?page=2 doesnt redirect appropriately, and archives/page/2/ redirects to some weird URL as listed before…I’ll try incognito

Alright the /page/2/ (both with and without /) appear to be working.

I’d like any direct requesets to archives.php?page=2 (example) to redirect appropriately. It doesn’t appear to be doing that (went incognito to confirm.)

That would be an infinite loop…

I mean I’d like that archives.php?page=2 to go to the new URL if possible.

Question though. I have include files outside of public_html

I’m going to rewrite all my links to go to the non .php version.

Can that include the files outside of public_html? Can I reference those files without .php? Or will the htaccess not reach there.

RR,

Possible but that requires a bit of advanced coding. Of course, if you had actually read my tutorial, you’d have seen the code to do exactly that (without looping). :disappointed:

Regards,

DK

RR,

External links or include() statements? Well, NO and NO anyway.

Regards,

DK

Ah ok well it was worth trying.

TBH it’s just not worth my time learning Apache, no offense. It’s such a limited area that I work with that I normally will just steal code and rework it. I’d rather put my learning time to other areas that affect my job.

Thank you for all of your help though, I really do appreciate it.

Erm, didn’t you say you were a front-end dev? :confused:

Yes, what do you find issue with what I said?

To clarify, I am a front end dev but I dabble with PHP at work.

The Apache messing that I do is for my personal websites.

What other clarification do you need?

Apache runs over half the active sites on the Internet, and regardless of whether you work developing on the front-end or the back-end technologies it’s pretty useful to at least know your way around a .htaccess file.

I just think “I don’t want to bother learning about x, I’ll just copy and paste a few code snippets” is a strange attitude to have for a web professional.

1 Like

I said that I have better technologies to learn that are more prudent. It’s not on the top of my list.

I never said I wouldn’t learn it. Not sure why you are putting words in my mouth.

RR,

I believe that fretburner merely pointed out that you’ve stated that you can’t be bothered to learn what you are asking about and wondered how a “front end developer” could take a “script kiddie” approach (my words) to coding. :thumbsup: fretburner

I’ve spent years here helping members learn while refusing to do free coding. Having directed you to my tutorial numerous times and being told that you couldn’t be bothered to read it - only copy and paste the code examples WITHOUT understanding what they do, I believe that I would be wasting my time to help further,

DK

1 Like