3cvillage Posted September 8, 2004 Share Posted September 8, 2004 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 Quote Link to comment Share on other sites More sharing options...
TCH-Rob Posted September 8, 2004 Share Posted September 8, 2004 Roy, Hang tight, I am not well versed in it but you should have an answer soon. Quote Link to comment Share on other sites More sharing options...
3cvillage Posted September 10, 2004 Author Share Posted September 10, 2004 Does anyone have any ideas? Roy Quote Link to comment Share on other sites More sharing options...
purplespider Posted September 14, 2004 Share Posted September 14, 2004 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 Quote Link to comment Share on other sites More sharing options...
TCH-Rob Posted September 14, 2004 Share Posted September 14, 2004 I think TCH-Robert is pretty good at it. Quote Link to comment Share on other sites More sharing options...
purplespider Posted September 15, 2004 Share Posted September 15, 2004 Well I've almost got it working, >RewriteEngine On RewriteRule ^(.*).php$ /home/phptest/public_html/index.php?page=$1 [L] Just need to find a way to exclude index.php from that rewrite so that it stops going in an endless loop. James Quote Link to comment Share on other sites More sharing options...
purplespider Posted September 15, 2004 Share Posted September 15, 2004 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 Quote Link to comment Share on other sites More sharing options...
rnmcd Posted January 9, 2005 Share Posted January 9, 2005 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 <{POST_SNAPBACK}> 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.