![]() |
| ||||||||
|
|||||||
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 |
|
www.linkabyss.com
War Room Member
Join Date: Oct 2007
Location: , , United Kingdom.
Posts: 833
Thanks: 18
Thanked 71 Times in 60 Posts
|
Hi,
I am having problems getting a mod rewrite on my .htaccess file to work. I have added the following code to the file........ Options +FollowSymLinks RewriteEngine on RewriteRule product-product-(.*)\.php product.php?product=$1 The original url is something like.... http://www.mysite.co.uk/product.php?...%20highlighter and I want the url to rewrite to.......... Example: http://www.mysite.co.uk/product-prod...ighlighter.php I have used a website tool to create this rewrite. Is there a reason this wouldn't work? Ideally, i'd like to rewrite the over url to something like......... http://www.mysite.com/product/Malmo-...th-highlighter I also have another url to rewrite to something like....... http://www.mysite.com/category/Highlighter-Pens Could anyone point me in the right direction of how I could do this? Any help would be greatly appreciated! Many thanks Andy |
|
NEW Online Article Creator! Now includes brand NEW content research feature!
FREE Article Rewriting Tool - Rewrite Existing Articles With Ease! Brand NEW Tool Just Launched! Brand NEW SEO Software Launching Soon! Link ABYSS One Way Link Building System - Offering Full Control And Flexibility Of Where You Obtain Your Links |
|
|
|
|
|
|
#2 | ||
|
HyperActive Warrior
Join Date: Mar 2009
Posts: 226
Thanks: 6
Thanked 27 Times in 27 Posts
|
Quote:
RewriteRule ^product-product-(.*)$ /product.php?product=$1 As far as... Quote:
1. rewrite the url 2. grab what ever is after "product/" 3. check the database for a match 4. if it doesn't match, display 404 5. if it does match, display page | ||
|
|
|
|
|
#3 |
|
www.linkabyss.com
War Room Member
Join Date: Oct 2007
Location: , , United Kingdom.
Posts: 833
Thanks: 18
Thanked 71 Times in 60 Posts
|
Thanks ehics,
Unfortunately that doesn't do anything. Whatever I seem to add just has no effect on anything. I contact my host last week and they said all I had to do was add the correct code to the .htaccess file which I have done. Nothing else needs to be 'turned on' according to them. I'm a bit stuck. If it changed something then at least i'd know I was on the right track but whatever I add to the .htaccess file, it doesn't make the blindest bit of difference. Andy |
|
NEW Online Article Creator! Now includes brand NEW content research feature!
FREE Article Rewriting Tool - Rewrite Existing Articles With Ease! Brand NEW Tool Just Launched! Brand NEW SEO Software Launching Soon! Link ABYSS One Way Link Building System - Offering Full Control And Flexibility Of Where You Obtain Your Links |
|
|
|
|
|
|
#4 |
|
Philipp Kostin
War Room Member
Join Date: Sep 2006
Location: Planet Earth
Posts: 53
Thanks: 8
Thanked 3 Times in 3 Posts
|
Just took a quick look on how my rewrites look like (i'm not a htaccess guru as well
)Looks a bit different - maybe you want to try it out: RewriteRule ^product-product-([^-]*).php$ /product.php?product=$1 [L] Note that there is no "\" before the .php Not sure but it might be the spaces in the product name that are causing problems ? I never have any spaces in an URL. Another option would be to track the products with an id and add the product name just for the SEO purposes. Let's say the product id in your database is 556. Within your product name, replace all spaces with "-" before you add it to the URL so the URL looks like this: http://www.mysite.com/product/556-Ma...th-highlighter Then this rewrite would definately do the job: RewriteRule ^product-product/([0-9]*)-([^-]*)$ /product.php?id=$1 [L] Then just get the product data by id rather than by product name within your product.php script (should be faster to get a int rather than varchar from the database as well) Hope that helps
|
|
|
|
|
|
#5 |
|
www.linkabyss.com
War Room Member
Join Date: Oct 2007
Location: , , United Kingdom.
Posts: 833
Thanks: 18
Thanked 71 Times in 60 Posts
|
Hi thanks! I'll try that out now. I would normally use an id, but because I wanted to use the product name or category name within the url I setup the system this way. As I programmed my system to not add duplicate product names I thought this would be ideal for SEO.
I'll give your url syntax a go and see what happens. Thanks! Andy |
|
NEW Online Article Creator! Now includes brand NEW content research feature!
FREE Article Rewriting Tool - Rewrite Existing Articles With Ease! Brand NEW Tool Just Launched! Brand NEW SEO Software Launching Soon! Link ABYSS One Way Link Building System - Offering Full Control And Flexibility Of Where You Obtain Your Links |
|
|
|
|
|
|
#6 |
|
www.linkabyss.com
War Room Member
Join Date: Oct 2007
Location: , , United Kingdom.
Posts: 833
Thanks: 18
Thanked 71 Times in 60 Posts
|
Just tried that and there is no difference to the displayed url at all. I'll spend the rest of the day trying to work this out otherwise i'll just get the site indexed with dynamic urls... which isn't what I wanted to do.
If you have any other ideas why it is not noticing the rewrite i'd love to hear them. Thanks Andy |
|
NEW Online Article Creator! Now includes brand NEW content research feature!
FREE Article Rewriting Tool - Rewrite Existing Articles With Ease! Brand NEW Tool Just Launched! Brand NEW SEO Software Launching Soon! Link ABYSS One Way Link Building System - Offering Full Control And Flexibility Of Where You Obtain Your Links |
|
|
|
|
|
|
#7 |
|
www.linkabyss.com
War Room Member
Join Date: Oct 2007
Location: , , United Kingdom.
Posts: 833
Thanks: 18
Thanked 71 Times in 60 Posts
|
My host said that I can't just do a mod rewrite using the .htaccess. He said with it using a mySQL databse I have to set the rule in the mySQL queries?!
Does anybody understand this or steer me in the right direction. I'm stuck. Thanks Andy |
|
NEW Online Article Creator! Now includes brand NEW content research feature!
FREE Article Rewriting Tool - Rewrite Existing Articles With Ease! Brand NEW Tool Just Launched! Brand NEW SEO Software Launching Soon! Link ABYSS One Way Link Building System - Offering Full Control And Flexibility Of Where You Obtain Your Links |
|
|
|
|
|
|
#8 |
|
www.linkabyss.com
War Room Member
Join Date: Oct 2007
Location: , , United Kingdom.
Posts: 833
Thanks: 18
Thanked 71 Times in 60 Posts
|
Thanks Guys, but i've managed to sort everything now :-)
|
|
NEW Online Article Creator! Now includes brand NEW content research feature!
FREE Article Rewriting Tool - Rewrite Existing Articles With Ease! Brand NEW Tool Just Launched! Brand NEW SEO Software Launching Soon! Link ABYSS One Way Link Building System - Offering Full Control And Flexibility Of Where You Obtain Your Links |
|
|
|
|
![]() |
|
| Tags |
| mod, question, rewrite, url |
| Thread Tools | |
|
|
![]() |