1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

SOLVED - .htaccess question

Discussion in 'Programming' started by stephan2307, Apr 11, 2019.

  1. #1
    Can't believe that I can't get this to work.
    SEMrush
    I have the following url
    /int/FULL-DEC18-100-F899139DF5E1059396431415E770C6DD.pdf

    And I need to rewrite it to this

    /int/index.php?$1

    I have this

    
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_URI} int
    RewriteRule ^int/(.*) /int/index.php [NC,L]
    
    Code (markup):
    But I get a 500 error.

    Any idea what I am doing wrong?
     
    stephan2307, Apr 11, 2019 IP
    SEMrush
  2. stephan2307

    stephan2307 Well-Known Member

    Messages:
    1,248
    Likes Received:
    23
    Best Answers:
    7
    Trophy Points:
    140
    #2
    Just tried this
    
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^int/?$    int/index.php    [NC,L] 
    
    Code (markup):
    and that results in a 404 and doesn't seem to try to rewrite

    Just to clarify I do want the url to stay the same just load via the /int/index.php file. And that file exists.
     
    stephan2307, Apr 11, 2019 IP
  3. stephan2307

    stephan2307 Well-Known Member

    Messages:
    1,248
    Likes Received:
    23
    Best Answers:
    7
    Trophy Points:
    140
    #3
    Never Mind, I got it to work

    
    RewriteEngine On
    RewriteRule ^int/(.*)$    int/index.php    [NC,L] 
    
    Code (markup):
     
    stephan2307, Apr 11, 2019 IP