Closed Thread Icon

Preserved Topic: mod_rewrite (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=21097" title="Pages that link to Preserved Topic: mod_rewrite (Page 1 of 1)" rel="nofollow" >Preserved Topic: mod_rewrite <span class="small">(Page 1 of 1)</span>\

 
JMJimmy
Bipolar (III) Inmate

From: Picton, Ontario, Canada
Insane since: Apr 2001

posted posted 09-27-2002 07:00

How would one go about changing domain.com/file.php?var=foo&var2=bar something that the less advanced robots can index the site?

Thanks,

JMJimmy

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 09-27-2002 08:05

Here are the solutions without using mod_rewrite Apache module:

http://www.evolt.org/article/Search_Engine_Friendly_URLs_with_PHP_and_Apache/17/15049/index.html
http://www.evolt.org/article/Search_Engine_Friendly_URLs_Part_II/17/17171/index.html


Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 09-27-2002 13:49

JMJimmy: Or just use mod_rewrite

Open up your .htaccess file and add something like this:

code:
RewriteEngine  on
RewriteRule file/([0-9]*)/([0-9]*)/ /file.php?var=$1&var2=$2 [L]



Its the method I prefer as it is non-destructive and so this rule acts purely as a 'mask' over the actual so you can still test the underlying URL if there are problems.

You will have to think a lot more carefully about how you create your URLs and about what gets passed through the URL.

[edit: The above code assumes you are doing file.php?var=2&var2=4 you'll need to adjust things to account for other things.]
___________________
Emps

FAQs: Emperor

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 09-27-2002 20:28

The beauty of solution that don't use mod_rewrite is that you can have a variable number of parameters passed...


Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 09-27-2002 21:20

And, of course, mr.maX is correct - mod_rewrite tends to be more inflexible hence the need for planning and a good grasp of the alternatives


___________________
Emps

FAQs: Emperor

JMJimmy
Bipolar (III) Inmate

From: Picton, Ontario, Canada
Insane since: Apr 2001

posted posted 10-02-2002 13:44

What are the other options? I can't get into evolt.org for some reason. As I understand it as soon as most robots see .php they stop and head to the next site.

JMJimmy

« BackwardsOnwards »

Show Forum Drop Down Menu