Results 1 to 7 of 7
  1. #1

    Issue: SEO friendly URLs get converted to the php long form automatically

    I'm guessing this is an Apache configuration issue, but not sure...

    I am using mod_rewrite to create SEO-friendly URLs. I noticed that on some servers, the SEO-friendly URL will get automatically converted to the long form equivalent (e.g. domain.com/file.php?a=z&b=y).

    Do you know to resolve this issue?

    Please let me know if further clarification is needed. Thanks.

  2. #2
    Join Date
    Jan 2011
    Location
    Maine
    Posts
    59
    Generally this happens when a sort or similar and you have not allowed for it in your mod_rewrite. For example if sorting on your page occurs you could use /this_keywords/sort/az
    E-nable My Biz!
    E-business development, marketing and webhosting.
    NEW! E-nabled FB Pages! Custom Facebook Pages for your business.

  3. #3
    After re write use redirection(301)

  4. #4
    Join Date
    May 2006
    Location
    New Zealand
    Posts
    6,482
    Sounds like you have your mod_rewrite entries around the wrong way. Care to post your .htaccess?
    █ | Brad - Hoopla Hosting - Email or add me to Gtalk! brad [at] hooplahosting.com
    █ | Web Hosting New Zealand - Reseller Hosting - cPanel - Zurmo Hosting - Softaculous - CloudFlare
    █ | VPS - SolusVM - E3-1230 - RAID10 - 1Gbit

  5. #5
    @Hoopla-Brad:
    Close, but i think that he is actually doing an EXTERNAL redirect, instead of an INTERNAL redirect. If so, he can fix this by NOT doing a redirect at all, at the end of the rewrite rule.

    @jimmybrion:
    Shouldn't you be using a 302 ?

  6. #6
    Sure, here's the .htaccess file.

    Code:
    RewriteEngine On
    RewriteBase /
    
    # zipcode
    ReWriteRule ^([a-z]+[0-9]*)-([a-z-]+)-jobs.*$ http://domain.com/zip.php?zip=$1&tab=$2 [NC]
    
    ErrorDocument 404 http://domain.com/index.php
    So, this works for on most servers. I think it has to do w/ how the customer is uploading the file (e.g. maybe wrong encoding). One customer said he FTPed as ASCII and it would convert to long form PHP, but when he uploaded as binary, it kept the SEO-friendly URLs.

    Thanks!

  7. #7
    Join Date
    Jun 2011
    Location
    > America/Mexico_City
    Posts
    93
    Code:
    ReWriteRule ^([a-z0-9]*)-([a-z-]+)-jobs.*$ zip.php?zip=$1&tab=$2

Similar Threads

  1. Frontpage Form needs to be converted to .php form
    By gariben in forum Employment / Job Offers
    Replies: 1
    Last Post: 03-10-2008, 04:01 AM
  2. SEO friendly urls
    By Mitac in forum Programming Discussion
    Replies: 6
    Last Post: 10-17-2007, 08:00 PM
  3. htaccess and SEO friendly urls
    By canz in forum SEO / SEM Discussions
    Replies: 1
    Last Post: 08-08-2007, 09:23 AM
  4. Best friendly urls/links with SEO
    By ebetz in forum Web Design and Content
    Replies: 1
    Last Post: 05-21-2006, 11:26 AM

Posting Permissions

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