What should the .htaccess file look like?

I need an apache .htaccess file that forwards all requested files, including images, to index.php with n as url parameter containing the requested filename

for example

 e.com/image.png --> e.com/index.php?n=image.png

Is that even possible?

(1 votes)
Loading...

Similar Posts

Subscribe
Notify of
4 Answers
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Ollig00
1 year ago

Moin,

if I understand it correctly, you want index.php load the respective images? As mentioned in the example, you have given a GET variable in the URL, so you want to load the image in PHP.

If that’s the right way to come. Otherwise, my proposed solution would be unnecessary.

MfG

Ollig00
1 year ago
Reply to  Mensch4

Okay, so you want to load several resources in your PHP? Because if so, it would be a little pointless by GET. If you want, we can talk about discord. Then I can help you much better.

If you like to send me a friendship request here, I will give you my ID.

MfG

NackterGerd
1 year ago

You couldn’t see any pictures in your website.

All images would lead to the index.

You sure you want that.