Reputation: 1
I've been trying for literally a few years. to rewrite my urls. I spend about 3 months at a time just trying. I've seen every example known to man yet nothing will work for me and I'm not stupid I managed to create my site by myself and its a lot more complex than silly htaccess.. so why can't I crack it!!
All I'm trying to do is turn this: http://www.mywebsite.com/videoPlayBack.php?videoID=BA5
Into this: http://www.mywebsite.com/videoPlayBack/BA5/
I've seen many other people request literally the same help with the exact same style url as the one I've posted yet some people can get it to work straight off the back and yet others like myself who copy and paste the same script are getting very different results..
I'm getting very frustrated because this is just not that important for it to be taking up years of my life and I'm not joking when I say years.
Please help somebody.. the examples I've seen must be old... I need the Y2K version
Upvotes: 0
Views: 36
Reputation: 786359
Enable mod_rewrite
and .htaccess
through httpd.conf
and then put this code in your .htaccess
under DOCUMENT_ROOT
directory:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
# external redirect from actual URL to pretty one
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+videoPlayBack\.php\?videoID=([^\s&]+) [NC]
RewriteRule ^ /videoPlayBack/%1? [R=301,L]
# internal forward from pretty URL to actual one
RewriteRule ^videoPlayBack/([^/]+)/?$ /videoPlayBack.php?videoID=$1 [L,QSA,NC]
Upvotes: 1