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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T22:35:36+00:00 2026-05-11T22:35:36+00:00

I managed to get some help from a previous question and I have the

  • 0

I managed to get some help from a previous question and I have the following in my .htaccess in my web root.

# REWRITE DEFAULTS
RewriteEngine On
RewriteBase /

# /view.php?t=h5k6 externally to /h5k6
RewriteCond %{THE_REQUEST} ^GET\ /view\.php
RewriteCond %{QUERY_STRING} ^([^&]*&)*t=([^&]+)&?.*$
RewriteRule ^/view\.php$ /%2 [L,R=301]

# /h5k6 internally to /view.php?t=h5k6
RewriteRule ^/(.*) /view.php?t=$1

However, if I type in this: http://www.example.com/7hde it will just give me a 404 error.

Am I missing something?

Thanks all

Update

This what I have now:

# /view.php?t=h5k6 externally to /h5k6
RewriteCond %{THE_REQUEST} ^GET\ /view\.php
RewriteCond %{QUERY_STRING} ^t=([0-9a-z]+)$
RewriteRule ^view\.php$ /%1 [L,R=301,QSA]

# /h5k6 internally to /view.php?t=h5k6
RewriteRule ^([0-9a-z]+)$ view.php?t=$ [L,QSA]

It seems to work but I can not make use of the Query string. Every time I try to get the value of t. I get this “$”?!

  • 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-05-11T22:35:37+00:00Added an answer on May 11, 2026 at 10:35 pm

    When using mod_rewrite in .htaccess files (see Per-directory Rewrites), the contextual per-directory path prefix is stripped before testing a rule and appended after applying a rule.

    In your case it is the leading / that needs to be removed from your patterns and substitutions:

    # /view.php?t=h5k6 externally to /h5k6
    RewriteCond %{THE_REQUEST} ^GET\ /view\.php
    RewriteCond %{QUERY_STRING} ^([^&]*&)*t=([^&]+)&?.*$
    RewriteRule ^view\.php$ /%2 [L,R=301]
    
    # /h5k6 internally to /view.php?t=h5k6
    RewriteRule ^(.*) view.php?t=$1
    

    You forgot that information in your last question. Otherwise I would have told you that back then.

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

Sidebar

Related Questions

Have you managed to get Aptana Studio debugging to work? I tried following this,
I asked before about pixel-pushing, and have now managed to get far enough to
I've somehow managed to get an SVN repository into a bad state. I've moved
I've managed to get a memory 'leak' in a java application I'm developing. When
Has anyone managed to get subsonic or a variant working on Windows Mobile? We
A little while ago I managed to get Visual Studio 2008 (C++) into a
I'm working on drawing an SVG grid using Javascript. I've managed to get the
I've managed to find the Regex to get almost the result I want here
Has anyone managed to use ItemizedOverlays in Android Beta 0.9? I can't get it
When starting a django application using python manage.py shell , I get an InteractiveConsole

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.