Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    ess
    ess is offline
    Regular Coder
    Join Date
    Oct 2006
    Location
    United Kingdom
    Posts
    866
    Thanks
    7
    Thanked 30 Times in 29 Posts

    Pretty URLs without Mod_ReWrite

    I was wondering if there is a way to create pretty or search engine friendly urls when mod_rewrite is not installed on a given server.

    Any suggestion or pointer to an article would be much appreciated it.

    Thanks
    ~E

  • #2
    Regular Coder PHP6's Avatar
    Join Date
    Aug 2008
    Location
    Czech Republic
    Posts
    238
    Thanks
    18
    Thanked 34 Times in 33 Posts
    Quote Originally Posted by ess View Post
    I was wondering if there is a way to create pretty or search engine friendly urls when mod_rewrite is not installed on a given server...
    To be honest that is too old term 'search engine friendly urls'. Most famous search engines like: google, yahoo, msn could understand everything after '?' char in the url and treat them as different ones. So, nowadays there are no much reasons to make 'urls nice', even in past that was just 1-2% of all SEO

    p.s. as an example you can take our forum codingforums.com, check the amount of cached pages... about 383,000

  • #3
    ess
    ess is offline
    Regular Coder
    Join Date
    Oct 2006
    Location
    United Kingdom
    Posts
    866
    Thanks
    7
    Thanked 30 Times in 29 Posts
    Quote Originally Posted by PHP6 View Post
    Most famous search engines like: google, yahoo, msn could understand everything after '?' char in the url and treat them as different ones. So, nowadays there are no much reasons to make 'urls nice', even in past that was just 1-2% of all SEO
    That doesn't answer my question though.

    I didn't ask how search engines go about listing or indexing web pages. I asked it is possible to create pretty urls or search engine friendly urls without using mod_rewrite.

  • #4
    Regular Coder PHP6's Avatar
    Join Date
    Aug 2008
    Location
    Czech Republic
    Posts
    238
    Thanks
    18
    Thanked 34 Times in 33 Posts
    Quote Originally Posted by ess View Post
    That doesn't answer my question though.

    I didn't ask how search engines go about listing or indexing web pages. I asked it is possible to create pretty urls or search engine friendly urls without using mod_rewrite.
    It depends what do you call nice if you need URL like that:

    _http://example.com/somepath/var1/var2/var3/index.htm
    when you need mod_rewrite and there is not other way to solve it (some script/program should handle that not existed URL... of cause you can try to catch it on 404 and do some redirects based on referrer but in that case you will have lots of errors in log file ). But if the following URL is nice too for you:

    _http://example.com/somepath/index.php/var1/var2/var3/index.htm
    then you can do it even without mod_rewrite.

    p.s. that is strange that you cannot find the similarity between my answer and you question, they are 90% dependent on each other. Of cause it was not a direct answer but it has the hint: 'there is not reason of making such nice URLs, it will be just waisting of you time' but it is up to you I am almost two years in SEO business and I know several ways how to bring almost any website to the google top. I wanted to share some information with you but if you do not want it is better for me

  • #5
    ess
    ess is offline
    Regular Coder
    Join Date
    Oct 2006
    Location
    United Kingdom
    Posts
    866
    Thanks
    7
    Thanked 30 Times in 29 Posts
    PHP6 well done for doing well in the SEO business. and NO, your previous answer does NOT get anywhere near 0.00001% to my question....and no, I am not going to talk about search engines or what you know about the SEO business.

    I am asking how to rewrite urls without using mod_rewrite. I used the term SEO as many people seem to associate it with writing urls such as the following, which is what I want to achieve without the use of mod_rewrite.

    Code:
    http://example.com/about
    http://example.com/about/history
    http://example.com/contact
    or

    Code:
    http://example.com/index.php/about
    http://example.com/index.php/about/history
    http://example.com/index.php/contact

  • #6
    Regular Coder PHP6's Avatar
    Join Date
    Aug 2008
    Location
    Czech Republic
    Posts
    238
    Thanks
    18
    Thanked 34 Times in 33 Posts
    Ok, feel free to think that my previous message was not answering your question... I am not going to argue regarding that subject, it will be wasting of your and my time.

    The more important is that now we know what are you looking for and that you will do those nice URLs in spite of everything... Since you are OK with such URLs:

    _http://example.com/index.php/about/history
    you will need to create index.php script which will parse the URL and redirects the user to required URL:

    PHP Code:
    <?php
      
    echo $_SERVER['REQUEST_URI'];
    ?>
    the request was:

    _http://example.com/test.php/somepath/var1/var2/index.htm
    the output was:

    /test.php/somepath/var1/var2/index.htm

  • #7
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    Only way I can think of is to modify your error404 page to contain some php to check the url entered, then split the url up and redirect/include the page you want to show. But, to modify your 404 page (location to your new php 404 page), you need to access your htaccess file :s So, thinking about that, scrap that idea.

    I can't think of a way

  • Users who have thanked Nightfire for this post:

    ess (09-07-2008)

  • #8
    ess
    ess is offline
    Regular Coder
    Join Date
    Oct 2006
    Location
    United Kingdom
    Posts
    866
    Thanks
    7
    Thanked 30 Times in 29 Posts
    Thanks Nightfire

    That was the only solution I could come up with as well....but wondered if any one has a different approach to utilizing ErrorDocs

    Cheers
    ~E

  • #9
    New to the CF scene
    Join Date
    Sep 2008
    Posts
    2
    Thanks
    0
    Thanked 1 Time in 1 Post
    An idea would be to take something like this:
    /test.php/somepath/var1/var2/index.htm
    and either explode it based on a particular number of psuedo-directories after the PHP script.
    Example (I can't remember the actual function to make this happen in PHP, however):
    PHP Code:
    //chop the $inputstring into an array delimited by "/"
    //reminds me of a CSV file

    $inputstring "/test.php/somepath/var1/var2/index.htm";
    $path $inputstring[1];
    $var1 $inputstring[2];
    //and so on 

  • Users who have thanked mlacy03 for this post:

    ess (09-08-2008)

  • #10
    Regular Coder
    Join Date
    Feb 2007
    Location
    Canada
    Posts
    924
    Thanks
    10
    Thanked 56 Times in 55 Posts
    why re-invent the wheel here... mod-rewrite works fine.

    If the Hosting Server you are using won't allow the use of mod-rewrite, get another host.

  • Users who have thanked jlhaslip for this post:

    ess (09-08-2008)

  • #11
    Regular Coder PHP6's Avatar
    Join Date
    Aug 2008
    Location
    Czech Republic
    Posts
    238
    Thanks
    18
    Thanked 34 Times in 33 Posts
    Quote Originally Posted by ess View Post
    Thanks Nightfire

    That was the only solution I could come up with as well....but wondered if any one has a different approach to utilizing ErrorDocs

    Cheers
    That’s my first off topic, here is prove that you do not read my posts Just couple of post before I have gave you that option but you do not pay attention to it... later, after 4 post you came to conclusion that Nightfire gave you good advice mega LOL

    09-06-2008 03:47 PM when you need mod_rewrite and there is not other way to solve it (some script/program should handle that not existed URL... of cause you can try to catch it on 404 and do some redirects based on referrer but in that case you will have lots of errors in log file ).
    Please take in consideration that next time I will not spend even one second on your question... you are so rude that you even do not say thank you for my help (I gave you two different solutions including 404)...

  • #12
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,853
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Hi PHP6,
    sorry for being off topic again, but "Pretty URLs" are not pretty to the search engines only, but to the users of the site too!

    Code:
    mysite.com/10/mypage => mysite.com/index.php?category=10&file=mypage
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • Users who have thanked abduraooft for this post:

    ess (09-08-2008)

  • #13
    Regular Coder PHP6's Avatar
    Join Date
    Aug 2008
    Location
    Czech Republic
    Posts
    238
    Thanks
    18
    Thanked 34 Times in 33 Posts
    Quote Originally Posted by abduraooft View Post
    Hi PHP6,
    sorry for being off topic again, but "Pretty URLs" are not pretty to the search engines only, but to the users of the site too!

    Code:
    mysite.com/10/mypage => mysite.com/index.php?category=10&file=mypage
    The topic starter mention term 'search engine friendly url' so I have explained (shared private information which costs money in SEO business) in first replay that this is old fashioned and outdated term... later he asks me that he wants to create that friendly urls anyway so I gave him two possible solutions (including 404 which he thanked) but I even do not get 'thank you' back. The little reward which users get here...

    As for the user friendly urls. That is very disputable question... since there is just few users who will type that url by heart:

    http://www.codingforums.com/148306/showthread/ => Pretty URLs without Mod_ReWrite

    that is the most simple version, while in most cases url has more than one parameter and with random numbers, which could just 1&#37; of all users remember. Most of them user bookmarks so in that case that user friendly urls are useless too

    Of cause I have forget to mention that user friendly urls uses lots of server's resources... that is why mod_rewrite is disabled on 99% shared hosting

  • #14
    Senior Coder djm0219's Avatar
    Join Date
    Aug 2003
    Location
    Wake Forest, North Carolina
    Posts
    1,300
    Thanks
    4
    Thanked 203 Times in 200 Posts
    Quote Originally Posted by PHP6 View Post
    Of cause I have forget to mention that user friendly urls uses lots of server's resources... that is why mod_rewrite is disabled on 99% shared hosting
    That's not really true. The amount of resources used for rewriting URLs is tiny unless you have a really huge set of rewrite rules (which is not the normal case). I don't know where you heard that rewrite is disabled on 99% of shared hosting but that also is not true at all.
    Dave .... HostMonster for all of your hosting needs

  • Users who have thanked djm0219 for this post:

    ess (09-08-2008)

  • #15
    Regular Coder PHP6's Avatar
    Join Date
    Aug 2008
    Location
    Czech Republic
    Posts
    238
    Thanks
    18
    Thanked 34 Times in 33 Posts
    Quote Originally Posted by djm0219 View Post
    That's not really true. The amount of resources used for rewriting URLs is tiny unless you have a really huge set of rewrite rules (which is not the normal case). I don't know where you heard that rewrite is disabled on 99&#37; of shared hosting but that also is not true at all.
    Thank for your input in discussion now that topics looks very interesting. I am not so good in server’s administration but in past I had such experience: I have couple of my own dedicated servers where mod_rewrite is enabled and some for just static data without mod_rewrite... (it is good for graphics, since the traffic costs are minimum).

    Once I have decided to move one of my websites (which needs mod_rewrite) to that static server and I have asked admin to enable mod_rewrite... he said that it is impossible since it will make high load of CPU. Of cause we are speaking about servers which has at list 30-50 million hits per day... for example codingforum.com should have up to 100 million hits per day, if they will use mod_rewrite in URL that will use lots of their server's resources.

    p.s. As for the shared hostings, probably they have no such experience before even my friend's forum was continuously closed, for the reason of high resources usage... websites with 10K unique visitors per day is ok but if you will have 100K that is a big problem I have such experience many times when you buy hosting and they promise you that you will not have any restrictions... but as soon as you mod_rewrite rules will cause high load they will block your account


  •  
    Page 1 of 2 12 LastLast

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •