Mobile app version of vmapp.org
Login or Join
Turnbaugh106

: Writing clean urls with .htaccess Update - Alright thanks everyone for your tests, it really helped. The code is good. My problem was not having absolute "/" links. (Due to moving from public_html

@Turnbaugh106

Posted in: #CleanUrls #Htaccess #Url #UrlParameters #UrlRewriting

Update - Alright thanks everyone for your tests, it really helped. The code is good. My problem was not having absolute "/" links. (Due to moving from public_html folder).

Only 2 concerns i have now.

1.) Replace "^achilles" with "^([0-9a-zA-Z_-]+)" and thumbnails wont appear (parameter data is not being carried???)

2.) How can I make funkygames.co/games/achilles/achilles/1 become even shorter like funkygames.co/games/achilles Or are the parameters absolutely mandatory.

# Turn Rewrite Engine On
RewriteEngine on

# Set the base to /games/ so we need not include it in the rules
RewriteBase /games/
#Rewrite for achilles.php?games_path=xxxxxxxxxx.yyy&category_id=zzz
RewriteRule ^achilles/(.*)/([0-9]+) .php?games_path=.swf&category_id= [NC,L]




Where i learned: youtube.com/watch?v=1pbAV6AU99I


SOLVED! Thanks to you guys.
Solution:

# Turn Rewrite Engine On
RewriteEngine on

# Set the base to /games/ so we need not include it in the rules
RewriteBase /games/
#Rewrite for achilles.php?games_path=xxxxxxxxxx.yyy&category_id=zzz
RewriteRule ^([0-9a-zA-Z_-]+)/([0-9]+) .php?games_path=.swf&category_id= [NC,L]

funkygames.co/games/achilles/1

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Turnbaugh106

2 Comments

Sorted by latest first Latest Oldest Best

 

@Reiling115

SOLVED! Thanks to you guys. Solution:

# Turn Rewrite Engine On
RewriteEngine on

# Set the base to /games/ so we need not include it in the rules
RewriteBase /games/
#Rewrite for achilles.php?games_path=xxxxxxxxxx.yyy&category_id=zzz
RewriteRule ^([0-9a-zA-Z_-]+)/([0-9]+) .php?games_path=.swf&category_id= [NC,L]

funkygames.co/games/achilles/1
If your website is appearing but its not showing pictures or dynamic database content. Then you must make sure you use absolute links

"/this-is-absolute"(will work from any folder)
"this-relative"(will only work from public_html)

10% popularity Vote Up Vote Down


 

@Harper822

I have: funkygames.co/games/achilles.php?games_path=achilles.swf&category_id=1
I want: funkygames.co/games/achilles/achilles/1 or even better: funkygames.co/games/achilles/1 (if that's possible)


Try this:

RewriteRule ^games/achilles/(.*)/([0-9]+)$ /games/achilles.php?games_path=.swf&category_id= [NC,L]


And if the game name needs to be case sensitive, remove the NC from [NC,L].

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme