1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Need help with Rewriting URL

Discussion in 'PHP' started by riteshsanap, Sep 22, 2010.

  1. #1
    Hello,
    I m new to PHP and wordpress i was going to make script that is SEO friendly and easy to use.

    But i m unable to do that because not understanding of the URL ?

    i m going to design the script like this
    http://btemplates.com/2010/blogger-template-club-theme/demo/
    Code (markup):
    Main stuff in this thing is the URL how to write it and getting that for POST ID if anyone able to help then please.

    and if you make the basic script that writes the URL like above and detection of post ID then i will be really happy and thank full to you.
     
    riteshsanap, Sep 22, 2010 IP
  2. riteshsanap

    riteshsanap Well-Known Member

    Messages:
    217
    Likes Received:
    2
    Best Answers:
    3
    Trophy Points:
    118
    #2
    Anyone please reply with solution
     
    riteshsanap, Sep 22, 2010 IP
  3. Benj Ash

    Benj Ash Member

    Messages:
    23
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    31
    #3
    What are you using htacccess? and apache
     
    Benj Ash, Sep 22, 2010 IP
  4. imperialDirectory

    imperialDirectory Peon

    Messages:
    395
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #4
    If you use Apache server, you can add something like this in your .htaccess file

    
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule !\.(js|ico|gif|jpg|png|css)$ /index.php
    
    Code (markup):
    This is just a sample. Adjust it to fit your need. Whatever in the URL will calls to "index.php". Then you can read the url from $_SERVER['REQUEST_URI'] and to load whatever content you need.

    If you use IIS server, then you can use something like ISAPI_Rewrite to achieve the same result.
     
    imperialDirectory, Sep 22, 2010 IP
  5. RadioBounce

    RadioBounce Banned

    Messages:
    4,171
    Likes Received:
    16
    Best Answers:
    1
    Trophy Points:
    0
    #5
    Do you want to know how to set the Wordpress permalink structure?

    If so go on to settings > permalinks and select custom structure and paste this in:

    /%year%/%postname%/
     
    RadioBounce, Sep 22, 2010 IP
  6. riteshsanap

    riteshsanap Well-Known Member

    Messages:
    217
    Likes Received:
    2
    Best Answers:
    3
    Trophy Points:
    118
    #6
    @GeekHang

    Hi i know that but i m saying making permalinks for my own plugin

    @imperialDirectory

    Isn't their any easy way to do this in Wordpress because i cannot see my .htaccess in filemanager

    or if possible can you make a simple script of it , if possible :D
     
    riteshsanap, Sep 22, 2010 IP
  7. riteshsanap

    riteshsanap Well-Known Member

    Messages:
    217
    Likes Received:
    2
    Best Answers:
    3
    Trophy Points:
    118
    #7
    Some one please atleast one good solution
     
    riteshsanap, Sep 22, 2010 IP
  8. dpa

    dpa Peon

    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Linux Hosting services include useful features like PHP and MySQL support, Apache Web Server, Chmod file permissions, and Mod Rewrite Support. Some of popular Linux hosting solutions include Debian, RedHat, and Slackware etc.
    URL Rewriting is the process of manipulating an URL or a link, which is send to a web server in such a way that the link is dynamically modified at the server to include additional parameters and information along with a server
     
    dpa, Sep 22, 2010 IP
  9. dpa

    dpa Peon

    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    With this code, your "mypage.php" script must examine the server variables to get the requested page or object URL-path, because your rewrite rule does not forward the requested resource URL-path to your script
     
    dpa, Sep 22, 2010 IP
  10. imperialDirectory

    imperialDirectory Peon

    Messages:
    395
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #10
    By default the .htaccess file does not exists until you make changes in permlink settings. Then wordpress creates the .htaccess file automatically. Here's a sample .htaccess file generated by wordpress
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /wordpress/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /wordpress/index.php [L]
    </IfModule>
    
    # END WordPress
    
    Code (markup):
    Maybe your file manager does not show files started with "."?

    If you need more information, the file that handles the rewrite rule is at /wp-includes/rewrite.php
     
    imperialDirectory, Sep 22, 2010 IP
  11. riteshsanap

    riteshsanap Well-Known Member

    Messages:
    217
    Likes Received:
    2
    Best Answers:
    3
    Trophy Points:
    118
    #11
    i have already this htacess i have checked it
     
    riteshsanap, Sep 23, 2010 IP
  12. riteshsanap

    riteshsanap Well-Known Member

    Messages:
    217
    Likes Received:
    2
    Best Answers:
    3
    Trophy Points:
    118
    #12
    Thanks i will check that rewrite.php
     
    riteshsanap, Sep 23, 2010 IP
  13. ChPeter

    ChPeter Peon

    Messages:
    974
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #13
    riteshsanap

    Our PHP programmers can successfully rewrite this URL for you for a very small price
    Be welcome to contact our website company
     
    ChPeter, Sep 27, 2010 IP