SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: .htaccess issue

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2008
    Posts
    46
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    .htaccess issue

    When redirecting via .htaccess, the new url shows up with a / at the ed. How do I prevent this from happening?

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^example\.com [nc]
    RewriteRule (.*) http://www.example.com/$1 [R=301,L]

    Redirect 301 /services http://www.example.com/services.php

    shows up as: http://www.example.com/services.php/ NOT http://www.example.com/services.php

  2. #2
    SitePoint Enthusiast
    Join Date
    Dec 2008
    Posts
    46
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I found the solution:

    # remove trailing slash
    RewriteRule ^(.*)/$ /$1 [L,R=301]


Bookmarks

Posting Permissions

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