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

  • SEARCH
  • Home
  • 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 7967513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:56:15+00:00 2026-06-04T06:56:15+00:00

I want to create flat links for my website. The .htaccess code is following:

  • 0

I want to create flat links for my website. The .htaccess code is following:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^([0-9A-Za-z]+)?$ /index.php?page=$1 [L]
    RewriteRule ^([0-9A-Za-z]+)/?$ /index.php?page=$1 [L]
</IfModule>`

Now my website is working which can be seen through print_r($_GET) and getting all the values.

My website has a code like this: <img src="images/icons/image.png" />, where the image resides on path: /images/icons/up.png.

Now I can visit my website as: http://somedomain.com/home and everything works fine. But when I put: http://somedomain.com/home/, it gets stuck.

The image gets a path like this for the browser: http://somedomain.com/home/images/icons/image.png which is not available and it should be: http://somedomain.com/images/icons/image.png.

How to solve this?

It would helpful if there is any solution by modifying the .htaccess as I want to use relative paths for all links and not full path.


Thanks to Ben Clifford for your help. According to him if I redirect the second rule one to the format like the first one and not over index.php. Then it should work.

  • 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-04T06:56:16+00:00Added an answer on June 4, 2026 at 6:56 am

    You could change that second rewrite rule to redirect the user to the non-/ version of the path, rather than to index.php; then when that redirected page is loaded it would hit the first rule, with the correct base path.

    The issue is that the image name replaces everything after the last / in the URL: when you say somedomain.com/home then the image filename is appended to somedomain.com/ but in the second case, the final / is after the home. Using a rewrite rule to prune this / off would fix that, i think.

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

Sidebar

Related Questions

We want to create a widget platform for a particular website. I couldn't find
I want to create a flat button with rounded right top and bottom corners.
I want to create a flat result set from the results of two methods
i want to create one ssis package which takes values from flat file and
I want create a excel with Apache POI in java and I must insert
i want create image animation , i have 50 images with png format now
I want create module which update list of usb devices automatically (not only mass
I want to create a file in the current directory (where the executable is
I want to create a class with a nested enum. public class Foo {
I want to create a stored procedure (on SQL Server 2005) that fetches a

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.