www.webdeveloper.com
Results 1 to 2 of 2

Thread: redirect for my rss feed

  1. #1
    Join Date
    May 2006
    Posts
    245

    redirect for my rss feed

    Hello,
    I have written a little php script to generate my rss file on demand.

    The script is on
    Quote:
    rss_feed.php?rss=$1
    As you can see it takes the rss variable to locate page.

    I want to use a url which is related to the page
    so it will be like this:

    Quote:
    example.com/rss_feed-5.xml
    Therefore my.htaccess file looks like this :

    Code:
    # GETTING RSS FILE BY PAGE NUMBER 
    
    RewriteCond %{HTTP_HOST} ^(.+).simpg.net$ [NC]
    RewriteCond %{HTTP_HOST} !^www.simpg.net$ [NC]
    RewriteRule ^[\.0-9,:\/-a-z]+rss_feed-([0-9]+)\.xml$ http://simpg.net/rss_feed.php?rss=$1 [NC,QSA,L]
    
    # GETTING SUPPORT PAGE BY PAGE NO
    # http://some-name.simpg.net/greatest-gadget/p1.html
    
    RewriteCond %{HTTP_HOST} ^(.+).simpg.net$ [NC]
    RewriteCond %{HTTP_HOST} !^www.simpg.net$ [NC]
    RewriteRule ^[\.0-9,:\/-a-z]+-p([0-9]+)\.html$ http://simpg.net/info.php?p=$1 [NC,QSA,L]
    When I click on my link, my server does NOT run the
    feed generator but runs runs the info.php script instead.

    Does anyone know what I have doen wrong ?

    Thanks



    .

  2. #2
    Join Date
    May 2006
    Posts
    245
    I have changed the hyphen to an underscore, I have done it in
    both the url link and the rewrite rule.
    but with no benefit

    I also tried putting END instead of L - but my server gives 500 Server Error
    with that.

    What I don't understand is why does my
    # GETTING SUPPORTING PAGES re-direct work OK
    ... without causing this re-re-direct

    and yet my
    # GETTING RSS FILE BY PAGE re-direct does NOT work.

    both seem to be very similar in rules and conditions.


    This is what I have now :
    Quote:
    # Redirect old file path to new file path
    # Redirect vacationvillasfethiyerental.villarentfethiye.simpg.net http://example.com/newdirectory/newfile.html

    # Re-direct for broken images
    # RewriteCond %{REQUEST_FILENAME} !-f
    # RewriteRule ^images/.*\.jpg$ /images/default.jpg [L]

    # GETTING RSS FILE BY PAGE NUMBER
    # http://villarentfethiye.simpg.net/rss_feed-5.xml

    RewriteCond %{HTTP_HOST} ^(.+).simpg.net$ [NC]
    RewriteCond %{HTTP_HOST} !^www.simpg.net$ [NC]
    RewriteRule ^(.*?)rss_feed-([0-9]+)\.xml$ rss_feed.php?rss=$2 [NC,QSA,L]

    # GETTING SUPPORTING PAGES BY PAGE NO
    # http://some-name.mobi6.net/greatest-gadget-p13.html

    RewriteCond %{HTTP_HOST} ^(.+).simpg.net$ [NC]
    RewriteCond %{HTTP_HOST} !^www.simpg.net$ [NC]
    RewriteRule ^(.*?)-p([0-9]+)\.html$ info.php?p=$2 [NC,QSA,L]

    # GETTING MAIN PAGE BY URL NAME
    RewriteCond %{HTTP_HOST} ^(.+).simpg.net$ [NC]
    RewriteCond %{HTTP_HOST} !^www.simpg.net$ [NC]
    RewriteRule ^.*$ http://simpg.net/info.php?a=%1 [NC,QSA,L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ 404.php?url=$1 [L]
    Any more thoughts on how I can fix this ?

    Thanks.


    .

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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