• Hello, i have a xampp localhost wp setup. htaccess works, mod_rewrite is on.
    The wp pages have multiple hyperlinks inside post body which visitors can click & open in new tab as https://localhost/mysite/tickets/Txtxjxxjxcxsx where Txtxjxxjxcxsx is different value for different links & contains numbers,alphabets & special characters like +,/,=

    I am trying to internally redirect https://localhost/mysite/Txtxjxxjxcxsx to https://localhost/mysite/tickets/book.php?id=Txtxjxxjxcxsx via htaccess but i am not getting any success. I tried the below rule :

    
    RewriteEngine on
    RewriteRule ^tickets/(.*)$ tickets/book.php?id=$1
    

    But i keep getting Error 403 Access Forbidden.
    Note when this htaccess rule is active , if i visit directly https://localhost/mysite/tickets/book.php?id=Txtxjxxjxcxsx , the book.php is able to execute & show output but visiting https://localhost/mysite/tickets/Txtxjxxjxcxsx gives Error 403 Access Forbidden.

    I also tried adding END flag :

    
    RewriteEngine on
    RewriteRule ^tickets/(.*)$ tickets/book.php?id=$1 [END]
    

    In this case too i get Error 403 Access Forbidden on visiting https://localhost/mysite/tickets/Txtxjxxjxcxsx But the new thing i noticed is that when this htaccess rule is active , i get a BLANK PAGE if i directly visit https://localhost/mysite/tickets/book.php?id=Txtxjxxjxcxsx .

    From what i understand in all my previous attempts with htaccess rules , when the server is asked by a visitor to open link https://localhost/mysite/tickets/Txtxjxxjxcxsx , it doesnt understand this link as the internal rewrite is not working and as the url https://localhost/mysite/tickets/Txtxjxxjxcxsx doesnt actually exist it might be showing me that error 403 as its unable to internally redirect to https://localhost/mysite/tickets/book.php?id=Txtxjxxjxcxsx ?

    I am a complete beginner in htaccess stuff, i had been trying to make it work since 2 days but i have not got any success.How to make it work & get the desired result ? Please help me. Thank you

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘.htaccess internal rewrite rule not working on wordpress links’ is closed to new replies.