Jump to content

URL rewriting - Please help


spires

Recommended Posts

Hi Guys.

 

I'm trying create a dynamic website, but also making it SEO Friendly.

 

I am currently reading 'Professional Search Engine Optimization with PHP',

which seems to be a great book on the subject. However, I have hit a wall.

 

So, If you know anything about URL rewriting, then please can you help.

 

 

So far I have (MAC):

 

- Contacted my hosting, and they have said:

"The Apache mod_rewrite module is already loaded by default on the apache installation that comes with Redhat 4ES."

 

- Removed # from: #LoadModule rewrite_module libexec/httpd/mod_rewrite.so

- Removed # from: #AddModule mod_rewrite.c

- Restarted Apache

 

- Created .htaccess file with the following information:

RewriteEngine on

 

# Translate my-super.product.html to /product.php?product_id=123

RewriteRule ^my-super-product\.html$ /product.php?product_id=123

 

 

But, I just get the error: the webpage does not exist.

 

Please can you help, as I can't see what else I can do.

 

 

Thanks in advance

 

 

Link to comment
Share on other sites

Hi, Thanks for your help.

 

I've changed the .htaccess to:

RewriteEngine on

 

# Translate my-super.product.html to /product.php?product_id=123

RewriteRule ^my-super-product.html$ /product.php?product_id=123 [NC,L]

 

 

But it is throws me out.

Am I doing it right?

 

 

Thanks once again.

 

 

Link to comment
Share on other sites

Just tested this:

 

RewriteEngine on

RewriteRule ^my-super-product.html$ product.php?product_id=123

 

It works when placed in the same folder as product.php. Note that I removed the slash in front of the "product.php?product_id=123" part.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.