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 7861469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T22:45:07+00:00 2026-06-02T22:45:07+00:00

I am trying to find out how to do something like this in htaccess:

  • 0

I am trying to find out how to do something like this in htaccess:

#This address links to a place that does not exist
localhost/prefix/games/userid/game-name

to silently ([L], i guess) redirect to

#This folder has an index.php, so we're good!
localhost/prefix/protected/files/userid/game-name/

I realise I can have a link:

localhost/prefix/games/index.php?user=userid&title=game-name

And just have the index.php have some redirect put in…

But I don’t want the url paramaters visible in a link on my website… So I guess it really does need to be htaccess.

I’ve got to admit, I read that htaccess stuff and it goes right past my head because noone has explained in a way I understand.

any help would be greatly appreciated.

EDIT::///

RewriteEngine On        
RewriteBase /prefix

# stop directory listings
Options -Indexes 

#stops htaccess views
<Files .htaccess>
order allow,deny
deny from all
</Files>

# remove .php; use THE_REQUEST to prevent infinite loops
    RewriteCond %{THE_REQUEST} ^GET\ (.*)\.php\ HTTP
    RewriteRule (.*)\.php$ $1 [R=301]         

# remove index
    RewriteRule (.*)/index$ $1/ [R=301]

# remove slash if not directory
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} /$
    RewriteRule (.*)/ $1 [R=301]

# add .php to access file, but don't redirect
    RewriteCond %{REQUEST_FILENAME}.php -f
    RewriteCond %{REQUEST_URI} !/$
    RewriteRule (.*) $1\.php [L]    

# redirect game folders
    RewriteRule ^prefix/games/(.*)$ /prefix/protected/files/$1/ [R=301]  
  • 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-02T22:45:09+00:00Added an answer on June 2, 2026 at 10:45 pm

    You can have

    RewriteRule ^prefix/games/(.*)$ prefix/protected/files/$1 [L]
    

    to redirect all http://localhost/prefix/games/userid/game-name links to http://localhost/prefix/protected/files/userid/game-name

    or, you can have

    RewriteCond %{QUERY_STRING} user=(.*)&title=(.*)$
    RewriteRule ^prefix/games/index.php$ /prefix/protected/files/%1/%2? [L]
    

    to move all links like: http://localhost/prefix/games/index.php?user=userid&title=game-name to http://localhost/prefix/protected/files/userid/game-name

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

Sidebar

Related Questions

I am just trying to find out that does puppet have something similar to
I'm trying to find out if there's a cleaner way to write something like
I am trying to find out how to write an SQL statement that will
I am trying to find out if an instance of an application (not vb.net)
I am trying to write a query to find out what users are not
I'm trying to do something like this: class foo { virtual void bool operator==(foo
I am trying to find out which event i should put my code that
I've been trying to find out the issue with this for days. As my
. . I walked in this morning to find out that a calendar, implemented
As a follow-up to this question , it's trying to find out how to

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.