Status
Not open for further replies.

Joseph Grogan

New Member
Hi i tried that mod rewrite to and it dont seem to be working for me either. It just leaves it as it was. Didnt change the name at all
 

Forbairt

Teaching / Designing / Developing
Ye, its on XP pro, i'll setup a redhat server tomorrow then and try get apache and all working on it! Never setup an *nix webserver box before! should be fun!

Ziycon if you are running apache on xp there should not be a problem make sure mod rewrite is enabled in apache. I test using xampp on my xp machine and have no problem testing mod rewrite.

I'd recommend xampp / wampserver .. (using wamp server cus its what I've used for ages ... if I was to do it again I'd probably move to xampp as there are a few extra nice things bundled with it)
 

davidbehan

New Member
Ziycon if you are running apache on xp there should not be a problem make sure mod rewrite is enabled in apache. I test using xampp on my xp machine and have no problem testing mod rewrite.

David my first one (no.2) should work as expected and leave the url as mysite.com/forum/ the same as with any other rule it doesn't add index.php, not sure why you thought it would.

The 3rd does have that obvious disadvantage but without knowing his forum setup it may the easiest way so its good to have it as an option, lateral thinking as you say.

Saying that I think your solution is the best one and would be the recommended one by me too.
Sorry, after looking again at it, you're right. I was thinking [R=301] for some reason. It was late when I was replying! :D
 

ziycon

New Member
I have the .htaccess file in the root folder of the webserver htdocs and i have the load module for mod_rewrite enabled but still wont reslove any of the address i type in!?
 

CiaranR

Weeno Ltd + Skimlinks.com
You should have the .htaccess file in html root folder of the site you are developing not your localhost root (i.e. beside your index.php)

what kind of error are you getting? did you restart apache after enabling the mod rewrite module?
 

ziycon

New Member
You should have the .htaccess file in html root folder of the site you are developing not your localhost root (i.e. beside your index.php)

what kind of error are you getting? did you restart apache after enabling the mod rewrite module?
It just gives me a 404 error! So confused!
 

ziycon

New Member
Another small query!:D

I want it to show the page number and the search type in a linkl, is there a better more efficient way to do this?

releases/1-all.htm
releases/2-some.htm

Where '1' is the $1 var and 'all' is the $2 var in the below rewrite rule:

RewriteRule ^releases/([0-9]+)-([^/]*)\.htm$ /releases.php?page=$1&stype=$2 [L,NC]
 

ziycon

New Member
I don't get it. Is that way not working for you?
It is working but im trying to get it to work with AJAX, i have a page and i want the link to show up say as /releases.htm but to have two variables in the 'real' link to say what page to go to and what sort order like, show only ones starting with a or show all results.

The orginal url is /releases.php?page=1&stype=a but im not sure if i mod_rewrite the url too /releases.php will the ajax script pick up on the different variables and populate the page properly?

Its just im unsure if the mod_rewite has to have the variable in the new url!
 

louie

New Member
the ajax call has to go to the server and bring you back the responseText so the RewriteRule will work if properly formated.
If you don't want to add the url to the onclick you can create eventListener for the respective link itself.
 
Status
Not open for further replies.
Top