Jump to content

Mod-rewrite?


3cvillage

Recommended Posts

Hello

 

I spoke with live chat support today asking about mod-rewrite support. They said it works fine, but that I need to make the changes in the .htaccess file. They said to use the same code and that it would work.

 

This is what I added to the bottom of my .htaccess file:

 

>   RewriteEngine on
   RewriteRule ^/view_item/(.*) /store/item_id=$1 [L]

 

It doesnt work though. Any ideas?

 

Roy

Link to comment
Share on other sites

Hey Roy,

 

Did you find a solution?

 

Because I am trying to use modrewrite to make a url like www.mysite.com/index.php?page=contact look like www.mysite.com/contact or www.mysite.com/contact.php

 

Anyone good with modrewrite??

 

Cheers

James

Link to comment
Share on other sites

Well I've found a solution to my problem, here's my code:

 

>RewriteEngine On
RewriteRule ^index\.php$ /home/phptest/public_html/index.php?page=welcome [L]

RewriteCond %{REQUEST_URI} !^/site.php
RewriteRule ^(.*)$ /home/phptest/public_html/site.php?page=$1 [L]

 

Basically what it does is this:

I have a template file called site.php - this just contains the page layout and a php include for $page where the content should be.

 

Putting the above code in the htaccess file means I can use urls like www.****/contact.php instead of www.****/index.php?page=contact which search engines don't like.

 

Roy:

 

Try putting a $ after (.*) to make this:

 

>RewriteEngine on
  RewriteRule ^/view_item/(.*)$ /store/item_id=$1 [L]

 

If that doesn't work please let me know exactly what you are trying to achieve and I will see what I can do.

 

James

Link to comment
Share on other sites

  • 3 months later...
Well I've found a solution to my problem, here's my code:

 

>RewriteEngine On
RewriteRule ^index\.php$ /home/phptest/public_html/index.php?page=welcome [L]

RewriteCond %{REQUEST_URI} !^/site.php
RewriteRule ^(.*)$ /home/phptest/public_html/site.php?page=$1 [L]

 

Basically what it does is this:

I have a template file called site.php - this just contains the page layout and a php include for $page where the content should be.

 

Putting the above code in the htaccess file means I can use urls like www.****/contact.php instead of www.****/index.php?page=contact which search engines don't like.

 

Roy:

 

Try putting a $ after (.*) to make this:

 

>RewriteEngine on
  RewriteRule ^/view_item/(.*)$ /store/item_id=$1 [L]

 

If that doesn't work please let me know exactly what you are trying to achieve and I will see what I can do.

 

James

 

James, is that code still working for you?

 

Is it possible to make the rewritten URL NOT have an extension--like you mentioned in the "Posted Sep 14 2004, 04:07 PM" thread: like www.mysite.com/contact

 

Thanks.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...