Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jul 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    This mod_rewrite rule does not work

    Hello....

    Can you check these conditions and rule?

    Code:
      RewriteBase /
    
      RewriteCond %{REQUEST_URI} ^/probando$
      RewriteCond %{REQUEST_URI} (/[^.]*|\.(php|html?|feed|pdf|raw))$ [NC]
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_URI} !frontend_dev\.php
      RewriteRule ^probando$ frontend_dev\.php [L]
    What I plan to do with this is, when someone enters URL http://www.mydomain.com/probando, I want the server to act like the following URL: http://www.mydomain.com/frontend_dev.php

    It works when I use

    Code:
    RewriteRule ^probando$ frontend_dev\.php [R=301,L]
    But I don't want a redirect because I want the URL in browser to remain unchanged.

    Any help will be greatly appreciated

    Thanks
    Jaime

  • #2
    New Coder
    Join Date
    Jul 2011
    Posts
    67
    Thanks
    0
    Thanked 13 Times in 13 Posts
    If you simply don't want the re-direct, why not just use the second example you posted but remove the R=301 part....

    Code:
    RewriteRule ^probando$ frontend_dev\.php [L]


  •  

    Posting Permissions

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