Jump to content

htaccess redirect help


chronister2

Recommended Posts

Hello Everyone,

I hope all are well in here. It's been a LONG time since I've been here... glad to see it still thriving and going strong. 

Here is my predicament. .......

I'm creating an article section on my website, sort of a mini-blog within the site and need some assistance with .htaccess redirects to make SEO friendly URLs

I've tried a ton of examples online and can't quite get it working

I'm trying to take

    https://mywebsite.com/Articles/viewArticle.php?article=name-of-article 

which is the current url and structure of pulling the articles. I've got a db field that holds name-of-article and pulls that as my URL argument on the viewArticle.php page. 

I want to pass the url structure as shown below and my .htaccess redirects the internal pointers to viewArticle.php and passes the name-of-article part as a var.

   https://mywebsite.com/Articles/name-of-article

I hope that makes sense. Here is the latest code I have attempted. This is in /Articles/.htaccess

Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On

RewriteRule /Articles/(.*) /viewArticle.php?article=$1

Any help is very appreciated.

 

Thanks,

Nathan

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.