Results 1 to 2 of 2

Thread: .htaccess is redirecting instead of rewriting

  1. #1
    Join Date
    Aug 2009
    Posts
    1

    Default .htaccess is redirecting instead of rewriting

    A simple subfolder to subfolder .htaccess rewrite (only it's redirecting instead).

    Code:
    RewriteEngine On
    RewriteRule ^pretty(.*)$ http://example.com/ugly/
    This works...except it redirects instead of rewrites. I don't want the url to show http://example.com/ugly ... I want it to show http://example.com/pretty

    I'm not using the [R] option. Why is it redirecting?

  2. #2
    Join Date
    Jul 2006
    Location
    Portland, OR
    Posts
    286

    Default

    Try this:
    Code:
    RewriteEngine On
    RewriteRule ^pretty(.*)$ /ugly/
    However, given that you are using the grouping construct, perhaps you really wanted this:
    Code:
    RewriteEngine On
    RewriteRule ^pretty(.*)$ /ugly/$1
    That still may not be what you really wanted. Perhaps this:
    Code:
    RewriteEngine On
    RewriteRule ^pretty/(.*)$ /ugly/$1

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •