Forum Moderators: phranque

Message Too Old, No Replies

I can't get the settings for mod_rewrite

new to that thingy

         

John_Keates

7:42 pm on Aug 28, 2005 (gmt 0)

10+ Year Member



Hey,

I've got apache2 and mod_rewrite, and a site that works. But now I want the url: [localhost...] change to [localhost...]

Is that possible with mod_rewrite?
if yes: tell me how to do that.

John

jd01

8:58 pm on Aug 28, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Uh, no, not really - basically you are going the wrong way.

Have a look in the library (links at the top left of the pages) should give you a start.

Justin

John_Keates

9:40 pm on Aug 28, 2005 (gmt 0)

10+ Year Member



Well, I read that. Does it mean I cannot use mod_rewrite?
If I can't, what do I have to do to make it work?

I want a link like: [site...] to be the same as
[site...] Is that possible? Like this forum. I don' think there are sub-dirs and html files for all those pages, so they tha too, didn't they?

Help please, I think I can't use mod_rewrite but I don't know what to do...

jd01

10:23 pm on Aug 28, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, you can do it, you will need to change the links on the page to the new structure you would like, then you can use mod_rewrite to serve the information from the 'real' page to the URL in the link.

We do not usually code on demand, so the best place to start is with your favorite SE and the query 'rewrite php files to html site:webmasterworld.com/forum92/'

You might also see this thread:
[webmasterworld.com...]

Justin

Added: site command to the search query.

John_Keates

5:30 am on Aug 29, 2005 (gmt 0)

10+ Year Member



I have read a lot about mod_rewrite, I know how it works but I can't write the Rules. Can someone help me with this?

my files:
[in the root on my hd]
/www/index.php

[on the web]
/index.php

variable?p=55 to /p/55 (or /p/55.html?)

simple but I don't know what to write as a rult to do that.

Is it possible to make the rule work when only /p/2 would be specifyed but not when a link like?p=8&name=Admin&time=today is used? So only when /p/10 is requested?

jdMorgan

9:42 pm on Aug 29, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



John_Keates,

Please take a moment to review our forum charter [webmasterworld.com]. In addition to helping you get the most from this forum, it also contains references to several useful document to help you write your rules.

You may use


RewriteCond %{QUERY_STRING} ^$

before your rewriterule to require a blank query string, in order to prevent requested URLs with parameters from being rewritten.

Jim

John_Keates

11:02 pm on Aug 29, 2005 (gmt 0)

10+ Year Member



Well I read that. And the apache mod_rewrite page and guide. Still I don't know what rule to write or what the exact function is I need. Sorry for wasting your time, I'll have to go on with Goolge and other SE unfriendly urls... Thx for the help but I don't think I will ever learn reg. exps. and how to use mod_rewrite. I will not ask you to make the rule for me. It wouldn't help because I need to know how things are done so I can do them myself. So no regexps and mod_rewrite for me :(

John