www.webdeveloper.com
Results 1 to 3 of 3

Thread: .htaccess if contains dash redirect

  1. #1
    Join Date
    May 2008
    Posts
    43

    .htaccess if contains dash redirect

    i have tried htaccess creators, but nothing is working

    i want to make it if the url contains a dash (last character)
    ex: http://site.com/a3s-
    to redirect to a file preview.php?id=a3s

  2. #2
    Join Date
    Jun 2009
    Posts
    127
    Kindly refer to below mentioned URL which might helps you to write the htaccess code in your .htaccess file.

    http://corz.org/serv/tricks/htaccess2.php

  3. #3
    Join Date
    May 2008
    Posts
    43
    Code:
    <IfModule mod_rewrite.c>
       RewriteEngine on
       RewriteOptions MaxRedirects=1
       RewriteBase /
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteCond %{REQUEST_FILENAME} !-l
       RewriteRule ^([a-zA-Z0-9_-]+)$ redirect.php?alias=$1 [L]
    </IfModule>
    what that is the code that is being used for the url shrink script

    i dont know if i need to add a separate module to say if that variable $1 contains a dash to redirect to preview.php?alias=$1
    and if it contants a-zA-Z0-9 to goto redirect.php?alais=1

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles