Status
Not open for further replies.

d-tour

New Member
Hey guys,

Is there a simple way to get SEO friendly hyperlinks and addresses from using the GET method.

One of my sites uses
Code:
http://www.drop-d.ie/archive/article.asp?article=494
to pull in an article from the database,

is there a way to pull the same info from a header without the "?" as in
Code:
http://www.drop-d.ie/archive/494/title-of-article

i dont mind moving from asp to do this.
It will help SEO, but i also hear google doesnt like indexing any pages that seem to have sessions in their address

Cheers guys,
 

louie

New Member
For asp there is a module that can be install on the IIS server that will automatically convert the normal url's into friendly ones.

For php you can use mod-rewrite .htaccess file.
Yes search engines doesn't like the session id inside the url and there are many articles about it.
Also you can make use of the robots.txt file to tell the spiders not to follow those url's.
PHP:
User-agent: googlebot
Disallow: /*sessionid=
the above solution is using wildcards to tell Gooogle not to index any URL containing the substring sessionid= anywhere within the URL.
 

paul

Ninja
hi,
I'm all very new to .htaccess files and I am looking for some tips...

Have a script that runs everything off the index.php page, so I guess for SEO it will be pretty bad.

I have a request that looks like
www.mydomain/index.php?action=category&cat_id=002

And I want it to look like
www.mydomain/shops/index.html

or
www.mydomain.ie/index.php?action=article&cat_id=004&id=4&lang=

And I want this to look like
www.mydomain.ie/article/4.html
or better
www.mydomain.ie/article/articlename.html

Also do I have to actually edit the index file, or will the .htaccess file parse my index.php file so that the links look nice ?


Thanks,
paul
 

louie

New Member
the .htaccess file will not change the links on your page.
That has to be done manually by yourself, either using a function or at design time.
Best using a function to handle the way links a created.

The .ht file will get the incoming URI and see if it matches any rules inside the file, and if YES then redirects to the right page without changing the URI.

This means that an /index.php?a=1&b=2 page can also be access by using this URI /1-2.html if there is a rule inside the .htaccess file that will know what to do with that request before it throws the 404 page
 

paul

Ninja
Thanks Louie ! I was fearing that that was the way things went. Now to see if I can hack the code a little then :D

I've been looking at this : Make Dynamic URLs Search Engine Friendly
which has been a great help, but now I am wondering about reusing varaibles in the database to bind things together .

i.e. use the article name in the database to be the name.

i.e for my example I have
Category : shopping
Title : Where can I shop for cheap
Cat ID : 2
Article ID : 4
so something like
www.mydomain.ie/shopping/where-can-i-shop-for-cheap.html would be great.

Time to modify some code I guess.
 

d-tour

New Member
Great replies, thanks for taking the time,

I see a lot of the modules for IIS need to be purchased, any chance of anyone reccomending an open source or freeware module?
 

paul

Ninja
now this is confusing me...
Code:
ptions +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^memeeme\.net
RewriteRule ^(.*)$ http://www.memeeme.net/$1 [R=permanent,L]


#RewriteRule ^review/* http://www.memeeme.net/ [R=301,L]



# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

so I have wordpress to rewrite my blog posts to look like http://www.memeeme.net/reviews/post1/
http://www.memeeme.net/reviews/post2/
http://www.memeeme.net/reviews/post3/

but now I am trying to redirect
http://www.memeeme.net/reviews/
to http://www.memeeme.net/

Louie or any other experts know what to do when you just want to redirect a file call like
http://www.memeeme.net/reviews/
http://www.memeeme.net/reviews/index.php

to http://www.memeeme.net/

Thanks,
p
 

paul

Ninja
Code:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^memeeme\.net
RewriteRule ^(.*)$ http://www.memeeme.net/$1 [R=permanent,L]

RewriteRule ^reviews/?$  [U]http://www.memeeme.net[/U] [R=301,L,NC]


# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress
nope. It doesn't rewrite memeeme.net/reviews/ to the home page

Thanks for the help and quick reply. I will try some other things....

actually it works. damn review/reviews ;)
 

paul

Ninja
Thanks ! Yeah. All is working. I just don't want people navigating around the site and then get a silly 404. Thanks again :D
 

louie

New Member
add this to your .ht file and create a nice 404.php page with your message:

Code:
ErrorDocument 404 /404.php
ErrorDocument 401 /404.php
ErrorDocument 400 /404.php
ErrorDocument 403 /404.php
ErrorDocument 500 /404.php
 

paul

Ninja
Wordpress has something inbuilt for 404's, so I am using that at the moment. I'm not sure what it gives for 401/400/203/500 though.
 
Status
Not open for further replies.
Top