logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Mod Rewrite
Author
mel150



Joined: 19 Jul 2018
Posts: 2
Location: United States

PostPosted: Tue 24 Jul '18 22:31    Post subject: Mod Rewrite Reply with quote

hi, I am a complete newbie, and have no idea how to do this. We have Apache 2.4 running on Linux.

We have a blog system. The blog are numbered, like this:
https://www.magickitchen.com/blog/?no=19
https://www.magickitchen.com/blog/?no=18
https://www.magickitchen.com/blog/?no=03

I call those into an html page, using:
<!--#include virtual="/cart/cgi/mini_blog.cgi?no=19" -->

But the pages are named in a user-friendly manner, like
https://www.magickitchen.com/blog/2018/4/what-is-net-neutrality-and-why-should-you-care.html

https://www.magickitchen.com/blog/2018/4/best-brand-based-april-fools-gags-2018.html


https://www.magickitchen.com/blog/2018/6/summer-bonding-with-grandkids.html

year/month/name-of-article.html

Can someone help me out with a mod rewrite, or is that asking too much? Thanks so much for looking at this question.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7294
Location: Germany, Next to Hamburg

PostPosted: Tue 07 Aug '18 11:59    Post subject: Reply with quote

How do you like to match the url with a name to a number? if your cgi can do that you might rewrite the whole blog to the cgi. The urls then must be stored in the programming or in a database.

Code:
RewriteEngine on

RewriteBase /blog/

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ /cart/cgi/mini_blog.cgi [QSA]


it is kind of the way wordpress rewrites the urls.
See https://codex.wordpress.org/htaccess
Back to top
mel150



Joined: 19 Jul 2018
Posts: 2
Location: United States

PostPosted: Tue 07 Aug '18 17:13    Post subject: Reply with quote

Thanks, that makes sense. We hired someone to do it, but I will suggest this, since it's still not working properly.
Back to top


Reply to topic   Topic: Mod Rewrite View previous topic :: View next topic
Post new topic   Forum Index -> Apache