.htaccess question
- Started
- Last post
- 25 Responses
- ********
I want to avoid having ?project=james in my urls how do I use a .htaccess rewrite for that? so my url is just mimeartist.com/project/james for instance? any tutorials for this?
- PSYKHO0
If you want a nosebleed read this:
http://httpd.apache.org/docs/1.3…Any easy tutorial:
http://www.easymodrewrite.com/
http://www.workingwith.me.uk/art…
- PSYKHO0
Hey really like your site and work!! Very cool...
- ********0
ta... anyone know the simple command to change
www.mimeartist.com/project/aka
to
www.mimeartist.com/index.php?pro…...
because as you say... that stuff is all a bit mental
- PSYKHO0
Do you use a CMS or something like that?
- ********0
i do... but i want people to send out really simple urls... rather than the ?p= type...
- YAYPaul0
Mime here's how i do mine:
RewriteEngine on
RewriteRule ^work/([A-Za-z0-9-]+)$ /work/$1/ [R]
RewriteRule ^work/([A-Za-z0-9-]+))/$ /index.php?entry=$1Drop me a mail if you need any specific help.
- PSYKHO0
you can, do you use wordpress? If you use WP then just tuen on permalinks.
- ********0
nah, i've built my own CMS and my flash takes the url and matches it to the document title...
thanks Paul, will try that now
- ********0
i hates the internet!
- ********0
thanks drgs...
any idea how i then set the base ref correctly? because now it thinks all the files should be in /project folder
- YAYPaul0
Sorry about that Mime its because i removed some things to make it easier to read... Here's the full one:
RewriteEngine on
RewriteRule ^work/([A-Za-z0-9-]+)/([A-Za-z0... /work/$1/$2/ [R]
RewriteRule ^work/([A-Za-z0-9-]+)/([A-Za-z0... /index.php?entry=$1&sort=$2
RewriteRule ^sort/([A-Za-z0-9-]+)$ /sort/$1/ [R]
RewriteRule ^sort/([A-Za-z0-9-]+)/$ /index.php?sort=$1
RewriteRule ^work/$ /index.php?section=work
RewriteRule ^about/$ /index.php?section=about
RewriteRule ^contact/$ /index.php?section=contact
RewriteRule ^thankyou/$ /index.php?section=thankyouErrorDocument 404 /notfound.php
AddHandler php5-script .php
- ********0
will that sort it knowing what folder i'm in?
- YAYPaul0
Which folder are you in when rewriting? The root?
- ********0
yep
- YAYPaul0
Ok so you want;
RewriteRule ^project/([A-Za-z0-9-]+)$ /index.php?project=$1
That should work.
*x's fingers :)
- ********0
trouble is it then thinks it is in the project folder and can't find the images as they are in the folder above
- YAYPaul0
How are you referencing the images?
I'm guessing if you change it to reference from the root that should be fixed.
I.E. /images/projects/etc/etc
- ********0
the .swf is in the root... but because it now thinks it is in 'project' it can't find them
- humm ok. Are they referenced virtually from the root (as above) within the SWF?YAYPaul
- ********0
i think it is the javacript that is not getting seen... swfobject.js