| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read | ![]() |
|
||||||
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
||||
|
Just came across this and thought it might be useful to someone. It can be a bit heavy going if you haven't used regular expressions but it's still a good overview of what is possible with mod-rewrite.
__________________
homo sum: humani nil a me alienum puto ... ( just Google it ) |
|
|||
|
Gawd Damn it! wish i never read the thread.
I have spend best part of 3 hours trying to mod-rewrite some simple dynamic links. I have tried nearly every example on the net and not one worked. I finally found a vid tutorial that kinda explained it in a language i am used to. I have just got it to work but i think the problem is i still don't fully understand it. Now I have simple urls with single query vars attached, as in the id=123 kind. Now it has never bothered me before as i was led to believe that single queries as apposed to complex url queries are fine with search engines...well they are not, and i can prove it. Anyway, all i want is to remove the ?id='' for something like /var I finally found this: Code:
Options +FollowSymlinks RewriteEngine on RewriteRule ^company/([0-9]+) co_details.php?id=$1 So, i simply changed the hyperlink to www.aol.com/company/$id as opposed to www.aol.com/company/find.php?id=$id Now all works ok but my question is this :is this the right way to do this? Is there an easier way that redirects to a virtual address? does anyone care? Did England really beat the Aussies?
__________________
West Dorset Community |
|
|||
|
Things could be worse Kev, you could have been a supporter of Welsh Rugby..............................oops! you were....may mistake
![]()
__________________
West Dorset Community |
|
|||
|
Hi Guys,
I know this is an old thread, but it concerns exactly what I am trying to do and am really struggling! It seems initially this was because mod_rewrite was not enabled on my Linux C Panel Premium. I spoke to technical support yesterday and they enabled it, however when I run phpinfo I cannot see it. I queried this with tech support and they said it is definately enabled. I guess I have probably made an error somewhere elese, not being very experienced, so I wondered if there is any other way I could check if mod_rewrite is enabled? At the moment when I try to access the pages which are supposed to be rewritten (I used a generator to try it out, to ensue it's not an error I have made) give the error 'You don't have permission to access .... Additionally a 404 Not Found error was encountered while trying to use an ErrorDocument to handle this request' Any ideas guys? Thanks in advance |
|
|||
|
Have got mod_rewrite working now, although having 1000's of URL's it would be great if I could recall field names from the database to use in the URL's rather than having to rewrite each one individually - any ideas. I'm using MySQL and PHP...
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|