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
    Senior Coder
    Join Date
    May 2006
    Posts
    1,680
    Thanks
    28
    Thanked 4 Times in 4 Posts

    Problem with my rewriteRule

    Hi again,

    I have another problem.

    I get 2 kinds of links coming to my server.

    This kind:

    1)
    villa-rent-siberia.example.com

    Which OK as I have this to redirect it:

    RewriteCond %{HTTP_HOST} ^(.+).example.com [NC]
    RewriteCond %{HTTP_HOST} !=www.example.com [NC]
    RewriteRule ^.*$ http://example.com/help.php?a=%1 [NC,QSA,L]

    Now the other type is more complex - t looks like this:

    2)
    villa-rent-siberia.example.com/17-vacationsinsiberia.html

    Actually it's not more complicated because it contains the record no. 17

    But I need to process this type before the first (1) because otherwise it will generate the wrong page.

    But I am not sure how to this.

    I have tried this:

    Code:
    Options +SymLinksifOwnerMatch 
    RewriteEngine On
    
    RewriteCond %{HTTP_HOST} ^(.+).example.com [NC]
    RewriteCond %{HTTP_HOST} !=www.example.com [NC]
    RewriteRule ^[\.0-9,-a-z]+\.example.com/([0-9]+)+[\.0-9,-a-z]+\.html$ http://example.com/info.php?a=%1 [NC,QSA,L]
    
    RewriteCond %{HTTP_HOST} ^(.+).example.com [NC]
    RewriteCond %{HTTP_HOST} !=www.example.com [NC]
    RewriteRule ^.*$ http://example.com/help.php?a=%1 [NC,QSA,L]
    Unfortunately that's not working for long url,
    info.php doesn't run, only help.php and it returns the wrong page.

    How can I get the info.php to run by extracting that no. 17 ?

    thanks for any help.



    .
    If you want to attract and keep more clients, then offer great customer support.

    Support-Focus.com. automates the process and gives you a trust seal to place on your website.
    I recommend that you at least take the 30 day free trial.

  • #2
    Senior Coder
    Join Date
    May 2006
    Posts
    1,680
    Thanks
    28
    Thanked 4 Times in 4 Posts
    Wow - Over a thousand page views.


    I have changed the rewrite rule to:

    Code:
    RewriteRule ^[\.0-9,-a-z]+\.example.com/([0-9]+)+-[\.0-9,-a-z]+\.html$ http://example.com/info.php?a=%1 [NC,QSA,L]
    But ... I am still having a problem with it,

    Any ideas what is wrong with it ?



    .
    If you want to attract and keep more clients, then offer great customer support.

    Support-Focus.com. automates the process and gives you a trust seal to place on your website.
    I recommend that you at least take the 30 day free trial.


  •  

    Posting Permissions

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