mod rewrite basics shared hosting

This is a discussion on "mod rewrite basics shared hosting" within the PHP Forum section. This forum, and the thread "mod rewrite basics shared hosting are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Feb 28th, 2008, 21:27
New Member
Join Date: Nov 2006
Location: bath
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
mod rewrite basics shared hosting

I've been deploying a technique for using search engine friendly urls where a 404 error page handles requests and includes the appropriate files. However, I've been finding that some people (seemingly at random) get sent 404 errors. I'm guessing this might be to do with php sending 404 headers before sending the page content.

I've also learned that google is not indexing all of the pages. My urls look like this:
Code: Select all
domain.com/products/My+Product+Name
I don't know if it's something to do with the urlencoding of spaces.
At any rate I wondering if I actually need to use genuine mod re-writes. But I can't find where to start. I am on shared hosting so I cannot edit the php.ini or httpd.conf files. Is this still possible? Where do I start? Does anybody know some simple starter tutorials for mod-rewrites?
Reply With Quote

  #2 (permalink)  
Old Feb 28th, 2008, 21:39
Junior Member
Join Date: Feb 2008
Location: Michigan
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Re: mod rewrite basics shared hosting

The rewrite stuff is probably handled via .htaccess files in your web directory - although you should ask your hosting company.
Reply With Quote
  #3 (permalink)  
Old Feb 28th, 2008, 21:59
New Member
Join Date: Nov 2006
Location: bath
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Re: mod rewrite basics shared hosting

I have a working htaccess file for handling the default page and the 404 document. Does this mean that I have everything I need to work with mod rewrites? Does it mean that the mod rewrite engine is 'on', or is there anything else I need to configure?

What do I need to start writing in my htaccess file? Can you supply some sample code or point me to a tutorial? As I say, most of the tutorials I find seem to infer that I need to change server files that I don't have access to on shared hosting...
Reply With Quote
  #4 (permalink)  
Old Feb 28th, 2008, 22:08
masonbarge's Avatar
Highly Reputable Member
Join Date: Jan 2006
Location: Atlanta GA
Posts: 631
Thanks: 0
Thanked 0 Times in 0 Posts
Re: mod rewrite basics shared hosting

You can make some php.ini modifications inside the page, if that helps. Or find a host that lets you modify settings.

For mod rewrite using an .htaccess file, you likely need to turn on the mod-rewrite engine with the line "RewriteEngine on" (LOL).

There are some great resources on the net. Just Google.
Reply With Quote
  #5 (permalink)  
Old Feb 28th, 2008, 22:25
New Member
Join Date: Nov 2006
Location: bath
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Re: mod rewrite basics shared hosting

OK, well i've googled

"php mod rewrite shared hosting tutorial"
and I get this:
http://www.devshed.com/c/a/Apache/Se...h-mod-rewrite/

It says I "need to have access to setting some options up in your httpd.conf or at least have a server admin who's willing to do it for you". I haven't looked into the tutorial that closely yet, but am I likely to be able to make the necessary settings in my php pages?

If I run a phpinfo(), what should I look for to establish if the server is set up correctly?
Reply With Quote
  #6 (permalink)  
Old Feb 28th, 2008, 22:40
New Member
Join Date: Nov 2006
Location: bath
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Re: mod rewrite basics shared hosting

I think I've found it...
http://www.workingwith.me.uk/article...ng/mod_rewrite
Reply With Quote
  #7 (permalink)  
Old Feb 28th, 2008, 23:09
New Member
Join Date: Nov 2006
Location: bath
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Re: mod rewrite basics shared hosting

Success! This tutorial is really great I've managed to get it working already. One last question: I'm concerned about the fact that google hasn't indexed my page. The URL looks like:
www.domain.com/products/My+Product+Name

Do you think that the url was not indexed because of the old technique of using the 404 error page to handle the request? What are my chances that the htaccess mod rewrite technique will fix this problem? Or are the urlencoded spaces and capitals a problem? Is there a quick way to find out if google can see my pages now, or do I have to wait (I don't want to wait and then find I still have a problem).
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
shared hosting clusters barryobrien Hosting & Domains 1 Nov 27th, 2006 13:25


All times are GMT. The time now is 11:54.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43