SEO 1 Links

  SEO Blog
  SEO Forum

  Active Topics
  Register
  Memberlist
  FAQ
  Search




SEO Forums

  SEO Forum
  SEM Forum

  Directories
  Link Networks
  Mod Rewrite
  Content
  Revenue Networks

  Marketing
  Social Bookmarking
  Webmastering

  Google
  Yahoo
  MSN

  Search
  Engines

  Link Exchange



Welcome

Time Now:
Tue Nov 21, 2017 6:05 pm

All times are GMT

Log in

Username:

Password:

 





 





Who is Online



Most users ever online in a day was 2917 on Thu Oct 25, 2007 4:43 pm
 



Member Websites

Free Sitewide Links
For Top Members





SEO 1 Forums > Mod Rewrite >

[Optimize URLs] Need Mod rewrite help



Author Thread
xboxundone
Senior Member


Joined: 04 Mar 2005
Good Posts: 243

[Optimize URLs] Need Mod rewrite help  Reply with quote  

I am using PHPNEWS and i want to do a mod rewrite for the following url


http://www.investingpub.com/new1.php?action=fullnews&id=44

I would like it to be

http://www.investingpub.com/44.html

any help is appreciated.


Post Sun Apr 10, 2005 2:26 pm
 View user's profile Send private message Visit poster's website
adrenalinepcs
Preferred Member


Joined: 08 Apr 2005
Good Posts: 108

 Reply with quote  

code:
RewriteEngine On
RewriteBase /
RewriteRule ^(.*).html$ new1.php?action=fullnews&id=$1



thats how you do it.

though i would recommend you do links like this: http://www.investingpub.com/news-4.html
and use this code
code:
RewriteEngine On
RewriteBase /
RewriteRule ^news-(.*).html$ new1.php?action=fullnews&id=$1





Website Design & Scripting - Adrenalinepcs - My-Health-Store
Post Sun Apr 10, 2005 3:03 pm
 View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
xboxundone
Senior Member


Joined: 04 Mar 2005
Good Posts: 243

 Reply with quote  

thanks but it doesnt seem to be working i added it to htaccess file


I guess i need to do some editing within the phpnews file but unsure what i would need to change.....

this may be some of the code i need to change but not sure as to what

code:
   /* Display link to show comments & news if enabled */
    if ($maintext != '' && $Settings['showcominnews'] == 1 && $Settings['enablecomments'] == 1)
    {
      $maintext = '<a href="' . $_SERVER['PHP_SELF'] . '?action=fullnews&amp;showcomments=1&amp;id=' . $news['id'] . '">' . $language['CONTENT_NEWSFULLSTORY'] . '</a>';
    }
    else if ($maintext != '')
    {
      $maintext = '<a href="' . $_SERVER['PHP_SELF'] . '?action=fullnews&amp;id=' . $news['id'] . '">' . $language['CONTENT_NEWSFULLSTORY'] . '</a>';
    }
    else
    {
      $maintext = '';
    }

    if ($Settings['enablestf'] == 1)
    {
      $sendtofriend = '<a href="javascript:sendtof(\'' . $Settings['phpnewsurl'] . 'sendtofriend.php?mid=' . $news['id'] . '\')">' . $language['CONTENT_NEWSSTFLINK'] . '</a>';
    }





Post Sun Apr 10, 2005 3:57 pm
 View user's profile Send private message Visit poster's website
Andrew
Senior Member


Joined: 21 Feb 2005
Good Posts: 997
Location: apache/domlogs
 Reply with quote  

You are calling CGI, so you might want to try adding the extra magic mentioned in this thread...

http://www.seo1.net/thread1557.html

Remember "[T=application/x-httpd-cgi]" goes on the same line at the end.
Post Sun Apr 10, 2005 4:47 pm
 View user's profile Send private message Visit poster's website
adrenalinepcs
Preferred Member


Joined: 08 Apr 2005
Good Posts: 108

 Reply with quote  

yeah you will need to modify your php file.

code:
/* Display link to show comments & news if enabled */
    if ($maintext != '' && $Settings['showcominnews'] == 1 && $Settings['enablecomments'] == 1)
    {
      $maintext = '<a href="news-' . $news['id'] . '.html">' . $language['CONTENT_NEWSFULLSTORY'] . '</a>';
    }
    else if ($maintext != '')
    {
      $maintext = '<a href="news-' . $news['id'] . '.html">' . $language['CONTENT_NEWSFULLSTORY'] . '</a>';
    }
    else
    {
      $maintext = '';
    }

    if ($Settings['enablestf'] == 1)
    {
      $sendtofriend = '<a href="javascript:sendtof(\'' . $Settings['phpnewsurl'] . 'sendtofriend.php?mid=' . $news['id'] . '\')">' . $language['CONTENT_NEWSSTFLINK'] . '</a>';
    }





Website Design & Scripting - Adrenalinepcs - My-Health-Store
Post Sun Apr 10, 2005 5:21 pm
 View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
xboxundone
Senior Member


Joined: 04 Mar 2005
Good Posts: 243

 Reply with quote  

It works guys thanks sooo much!! :)


Post Sun Apr 10, 2005 6:18 pm
 View user's profile Send private message Visit poster's website
adrenalinepcs
Preferred Member


Joined: 08 Apr 2005
Good Posts: 108

 Reply with quote  

glad to help you :)


Website Design & Scripting - Adrenalinepcs - My-Health-Store
Post Sun Apr 10, 2005 7:24 pm
 View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
xboxundone
Senior Member


Joined: 04 Mar 2005
Good Posts: 243

 Reply with quote  

quote:
Originally posted by adrenalinepcs
glad to help you :)


Yep even took the time to vamp it up for html ending on other sites thanks for the help ;)


Post Sun Apr 10, 2005 7:35 pm
 View user's profile Send private message Visit poster's website

Reply to topic
Jump to:  
Display posts from previous:      






SEO 1 © 2005-2015 - SEO 1 the SEO Forum