Announcement

Collapse
No announcement yet.

.htaccess rewriting search links etc.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    .htaccess rewriting search links etc.

    It occurred to me that with some tweeking of the .htaccess file (if you don't know what this is, search the forum) cgi urls could be made a little more attractive/memorable.

    Code:
    #nice search links
    RewriteEngine On
    RewriteRule ^SS/([^/]*)\.html$ /cgi-bin/ss000001.pl?page=search&SS=$1&PR=-1&TB=A [L]
    With the above added to the .htaccess file, the website can be searched using a simple link without any of the /cgi-bin/ss000001.pl?page=search&SS= etc.

    e.g. www.mywebsite.com/SS/my+search+words.html

    This has the same effect as typing "my search words" into an actinic search field. It could be used for more seo friendly internal linking or in an email.

    The other application I'm using it for is to make the contact us form url more memorable:

    Code:
    #nice link to contact us form
    RewriteEngine On
    RewriteRule ^email_us\.html$ /cgi-bin/mf000001.pl?ACTION=SHOWFORM [L]
    With the above added to the .htaccess file, the contact form is shown by going to the url:

    www.mywebsite.com/email_us.html

    #2
    Hi Jonathan.

    Do you have a sample site where we can see your work live in action?

    Cheers,
    Grant

    Comment

    Working...
    X