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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:01:43+00:00 2026-05-28T03:01:43+00:00

Initially, this code was written to create pretty urls. When using the code below,

  • 0

Initially, this code was written to create “pretty” urls.

When using the code below, mod_rewrite works as it should.

<Directory /var/www/vhosts/myurl.com/httpdocs>
    Options Indexes FollowSymLinks
    php_admin_flag engine on
    php_admin_value open_basedir none
    AllowOverride all
    Order allow,deny
    Allow from all
</Directory>

RewriteEngine on
RewriteCond %{HTTPS} !=off
RewriteCond %{LA-U:REQUEST_FILENAME} !-f
RewriteCond %{LA-U:REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index\.php$
RewriteCond $1 ^(register|account|logout|profile|edit_profile).*$
RewriteRule ^/(.*)$ https://myurl.com/?get=$1 

It takes any matching url such as https://myurl.com/register and rewrites it as https://myurl.com/?get=register. The appropriate page is found and displayed in the browser.

However, I want the original url to be passed through to the browser. To achieve this, I added the [PT] Flag to my RewriteRule as shown below:

RewriteRule ^/(.*)$ https://myurl.com/?get=$1 [PT]

This lets https://myurl.com/register (same url as above) through to the browser but no longer displays the page. Instead, it returns the following error:

Bad Request
Your browser sent a request that this server could not understand.
Client sent malformed Host header

Relevant Info:

OS: Linux
Server: Apache
Control: Plesk
Directory: /var/www/vhosts/myurl.com/conf
File: vhost_ssl.conf

I’ve searched multiple forums and articles to no avail.

Article 1: Making prettier URLs with mod_rewrite (includes use of [PT] Flag)

Does anyone have ideas on what’s going on here and how to fix it? How can I get the “pretty” url to display?

  • 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-28T03:01:43+00:00Added an answer on May 28, 2026 at 3:01 am

    So after two days of frustration, I finally solved the puzzle.

    First I experimented with the RewriteRule from by changing it from:

    RewriteRule ^/(.*)$ https://myurl.com/?get=$1 [P]
    

    to

    RewriteRule ^/(.*)$ https://myurl.com/index.php?get=$1
    

    without any flags.

    This produced an infinite loop whenever the rewrite was triggered. But I noticed that the loop was happening without redirecting the url (maintaining the ‘pretty url’). Progress!

    I decided to simplify the code. I removed ‘LA-U:’ from the RewriteCond as shown below:

    RewriteCond %{LA-U:REQUEST_FILENAME} !-f
    RewriteCond %{LA-U:REQUEST_FILENAME} !-d
    

    to

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    

    That did the trick! Thanks to those that commented. Hope this helps someone in the future.

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

Sidebar

Related Questions

This is the PHP code im using in conjunction with jQuery .ajax to create
I have this jQuery datepicker code that initially set the minDate of the datepicker.
Warning: This is inherited legacy code that was initially put together in the early
For this assignment I had to create my own string class. I initially wrote
I have recently begun learning the Win32 API using this tutorial: http://www.winprog.org/tutorial/ (though I'm
I have inherited code for an iPhone app using Core Data written by another
In other words, a block of code like this: (setq initial-major-mode (lambda () (text-mode)
Suppose I have code like this: template<class T, T initial_t> class Bar { //
Initially I thought this was going to work, but now I understand it won't
EDIT: This question was initially too general, I think. So What I really need

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.