Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8674777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:47:18+00:00 2026-06-12T19:47:18+00:00

I have a directory in my root called images. I have a naming convention

  • 0

I have a directory in my root called images. I have a naming convention of number-category.jpg. I am using this convention through a PHP script and would like to have a RewriteRule in my htaccess that does something to the effect of word-word-category-number.jpg for SEO purposes.

So what was once ‘10-abstract.jpg‘ is now ‘fine-art-abstract-art-10.jpg‘

I was reading some tutorials and came up with below with no success:

RewriteRule ^([0-9]-[a-z])-art.jpg$ /2/art/$1-$2.jpg [L]
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T19:47:19+00:00Added an answer on June 12, 2026 at 7:47 pm

    For word-word-category-number.jpg, try:

    RewriteRule ^[^-]+-[^-]+-([^-]+)-([0-9]+)\.jpg$ /2/art/$2-$1.jpg [L]
    

    But that’s not going to work for your example because fine-art-abstract-art-10.jpg is word-word-category-word-number.jpg. You can add another section for that:

    RewriteRule ^[^-]+-[^-]+-([^-]+)-[^-]+-([0-9]+)\.jpg$ /2/art/$2-$1.jpg [L]
    

    And that’ll take a request for http://your.domain.com/fine-art-abstract-art-10.jpg and serve /2/art/10-abstract.jpg.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Ubuntu and have a directory called webchat, under this directory there are
I have a directory called private. You can access the index.php file by using
I have a script called 'sess-start.php' which lies in an /include directory within my
Consider I have a directory called root that has two directories: x and y
I have this directory structure. In my project root directory I have a main
In my server root I have a directory called repos. I would like request
We can modify the document root directory path for PHP using $_SERVER['DOCUMENT_ROOT'] = to/some/new/directory;
I have a directory in the root of my codeigniter application called /css it
I have a TortoiseHG (2.3.2) repository containing a directory at the root called cv2
(r'^media/(?P<path>.*)$', 'django.views.static.serve',{'document_root': settings.MEDIA_ROOT}), As you can see, I have a directory called media under

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.