Matias Næss
Matias Næss

Reputation: 267

.htaccess mod_rewrite 404 not found

My url is now mysite.com/steam/g?appid=730

What I want is: mysite.com/steam/directory/730

Here is what I have so far:

 Options +FollowSymLinks -MultiViews
    # Turn mod_rewrite on
    RewriteEngine On
    RewriteBase /

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^/directory/(.*)$ /steam/g.php?appid=$1 [L,QSA,NC]

Now this will only give me a 404 not found. I believe mod_rewrite is enabled as I can rewrite everything to https and remove the .php .html etc. I'm using a web host.

Any idea what could be wrong?

Upvotes: 1

Views: 894

Answers (2)

Dom
Dom

Reputation: 3080

I think you want

RewriteRule ^steam/directory/(.*)$ /steam/g.php?appid=$1 [L,QSA,NC]

Upvotes: 2

Adrianopolis
Adrianopolis

Reputation: 1292

Assuming your original URL was: http://example.com/steam/g.php?appid=730 I think the following should get you the format you want.

RewriteRule ^steam/directory/([^/]*)$ /steam/g.php?appid=$1 [L,QSA,NC]

Upvotes: 3

Related Questions