简体   繁体   中英

Apache 2.4 .htaccess PHP Not Working

I have spent my whole day trying to make this work, and I cannot make it happen.

I have a server with GoDaddy where I test websites I create. I am trying to work on a friendly-url system with htaccess, and it will not work.

The file is saved on the folder eureka It looks like this:

RewriteEngine On

RewriteRule trips/([0-9]+) trip_details.php?trip_id=$1 [NC,L]

When someone goes to http://www.jseeh.com/eureka/trips/22 I want them to be redirected to http://www.jseeh.com/eureka/trip_details.php?trip_id=22

Any help will be greatly appreciated

it looks like you're omitting the eureka directory. try something like this and see if it works

RewriteRule ^/eureka/trips/([0-9]+)\/? eureka/trip_details.php?trip_id=$1 [L]

Edit: New answer based on OP's reply below. Tested and working on Apache with your directory setup.

Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase /eureka

RewriteRule trips/([0-9]+)\/? trip_details.php?trip_id=$1 [L]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM