gotit Posted November 17, 2006 Share Posted November 17, 2006 I need to rewrite my url.currently it reads like:/system/listingView.php?listingCode=1029/system/listingView.php?listingCode=1030..../system/listingView.php?listingCode=1050Spiders might read them all as one page...I prefere for the url to reflect some variables from the page like Listing_address and/or Listing_styleI have very limited knowledge of html thanx Quote Link to comment https://forums.phpfreaks.com/topic/27529-help-needed-with-php-url-rewrite-please/ Share on other sites More sharing options...
Seraskier Posted November 17, 2006 Share Posted November 17, 2006 can you explain more in detail what you want and your situation Quote Link to comment https://forums.phpfreaks.com/topic/27529-help-needed-with-php-url-rewrite-please/#findComment-125864 Share on other sites More sharing options...
gotit Posted November 17, 2006 Author Share Posted November 17, 2006 What I want for my URL not to show as bellow.[s][b]/system/listingView.php?listingCode=1029[/b][/s]These pages are dynamically generated, so for every new page there is a new number at the end of URL, everything else looks the same.If I can get the pages to show different, one from the other.Look at my first post above for URLs readings.thanx Quote Link to comment https://forums.phpfreaks.com/topic/27529-help-needed-with-php-url-rewrite-please/#findComment-125870 Share on other sites More sharing options...
Seraskier Posted November 17, 2006 Share Posted November 17, 2006 i still dont understand what you are asking. Quote Link to comment https://forums.phpfreaks.com/topic/27529-help-needed-with-php-url-rewrite-please/#findComment-125871 Share on other sites More sharing options...
doni49 Posted November 17, 2006 Share Posted November 17, 2006 put the following in your .htaccess file.[code]RewriteEngine OnRewriterule ^system/listing([0-9]+).html$ /system/listingView.php?listingCode=$1[/code]Then goto www.mydomain.com/system/listing1029.html Quote Link to comment https://forums.phpfreaks.com/topic/27529-help-needed-with-php-url-rewrite-please/#findComment-125878 Share on other sites More sharing options...
gotit Posted November 17, 2006 Author Share Posted November 17, 2006 I created a new file in note pad and named it .htaccessI put the code in the fileAfter I uploaded the file in /system folder I took out the .txt extentionStill there is no change to my url Quote Link to comment https://forums.phpfreaks.com/topic/27529-help-needed-with-php-url-rewrite-please/#findComment-125894 Share on other sites More sharing options...
doni49 Posted November 17, 2006 Share Posted November 17, 2006 You can't "name it .htaccess" in notepad. Windows won't allow you to create a file without a name (BEFORE the period).go into cpanel's file manager and create the file there.EDIT: SHOULD have said "can't" above. Quote Link to comment https://forums.phpfreaks.com/topic/27529-help-needed-with-php-url-rewrite-please/#findComment-125900 Share on other sites More sharing options...
gotit Posted November 17, 2006 Author Share Posted November 17, 2006 By the way, the page title code worked..........thanks for your helpI did that, i named my file .htaccess in notepad when i uploaded it with ftp, i see the extention then as .txt so i deleted this extention there.Is there another way of creating this file? Quote Link to comment https://forums.phpfreaks.com/topic/27529-help-needed-with-php-url-rewrite-please/#findComment-125901 Share on other sites More sharing options...
gotit Posted November 17, 2006 Author Share Posted November 17, 2006 and if i want the file in /system directory, do load this file in this directory or else? Quote Link to comment https://forums.phpfreaks.com/topic/27529-help-needed-with-php-url-rewrite-please/#findComment-125917 Share on other sites More sharing options...
doni49 Posted November 17, 2006 Share Posted November 17, 2006 [quote author=gotit link=topic=115271.msg469313#msg469313 date=1163726627]By the way, the page title code worked..........thanks for your helpI did that, i named my file .htaccess in notepad when i uploaded it with ftp, i see the extention then as .txt so i deleted this extention there.Is there another way of creating this file?[/quote]The "other way" is specified above (I'm assuming you have CPanel access to a hosting account).Windows [size=12pt][b]will not allow[/b] [/size]you to create a file named the way it needs to be named.The file needs to be named [b].htaccess[/b]--period (with NOTHING before it) followed by htaccess. Quote Link to comment https://forums.phpfreaks.com/topic/27529-help-needed-with-php-url-rewrite-please/#findComment-125930 Share on other sites More sharing options...
LuckyBambu Posted November 17, 2006 Share Posted November 17, 2006 [quote author=doni49 link=topic=115271.msg469345#msg469345 date=1163730942][quote author=gotit link=topic=115271.msg469313#msg469313 date=1163726627]By the way, the page title code worked..........thanks for your helpI did that, i named my file .htaccess in notepad when i uploaded it with ftp, i see the extention then as .txt so i deleted this extention there.Is there another way of creating this file?[/quote]The "other way" is specified above (I'm assuming you have CPanel access to a hosting account).Windows [size=12pt][b]will not allow[/b] [/size]you to create a file named the way it needs to be named.The file needs to be named [b].htaccess[/b]--period (with NOTHING before it) followed by htaccess.[/quote]I'm not sure I heard you correctly. I can go into notepad and save a file as .htaccess without any problem, and upload it and have it work. Why don't you try it? Quote Link to comment https://forums.phpfreaks.com/topic/27529-help-needed-with-php-url-rewrite-please/#findComment-125937 Share on other sites More sharing options...
doni49 Posted November 17, 2006 Share Posted November 17, 2006 Windows [color=red][size=20pt][b]will not allow[/b] [/size][/color]you to create a file named the way it needs to be named.A file [b]MUST[/b] have a file name--the extension (part AFTER the period is optional) but the portion before the period is [b]ABSOULUTELY[/b] required. Quote Link to comment https://forums.phpfreaks.com/topic/27529-help-needed-with-php-url-rewrite-please/#findComment-125941 Share on other sites More sharing options...
LuckyBambu Posted November 17, 2006 Share Posted November 17, 2006 [quote author=doni49 link=topic=115271.msg469356#msg469356 date=1163731582]Windows [color=red][size=20pt][b]will not allow[/b] [/size][/color]you to create a file named the way it needs to be named.A file [b]MUST[/b] have a file name--the extension (part AFTER the period is optional) but the portion before the period is [b]ABSOULUTELY[/b] required.[/quote]Would you like me to record a video of me doing exactly what you say is impossible? Quote Link to comment https://forums.phpfreaks.com/topic/27529-help-needed-with-php-url-rewrite-please/#findComment-125942 Share on other sites More sharing options...
doni49 Posted November 17, 2006 Share Posted November 17, 2006 OK I digress. You seemed so sure of yourself, I decided to try it. This just goes against EVERYTHING I've ever experienced, read or been taught. In notepad's Save As dialog, where it asked for a filename, I typed ".htaccess" (WITH the quotes) and it saved the file. I was even able to double click on it to open it.One thing I can tell you with absolute certainty is that creating a new file (in Windows Explorer) and trying to name it that will not work (yes I tried after I saw this work).EDIT: Fixed typo. Quote Link to comment https://forums.phpfreaks.com/topic/27529-help-needed-with-php-url-rewrite-please/#findComment-125944 Share on other sites More sharing options...
gotit Posted November 17, 2006 Author Share Posted November 17, 2006 One thing I don't understand is:when i creat the file past the code in it and then want to save as--- I simply past ".htaccess" in the file name with nothing following it.and this file shows as .htaccess on my pc, but once I load it it shows as ".htaccess.txt" on the server. Does that has to do anything with it.I also tried deleting that .txt on the server.I do have access to hosting control panel, but there is no option for me to creat a filethese are the options categories:1and1 is the host Quote Link to comment https://forums.phpfreaks.com/topic/27529-help-needed-with-php-url-rewrite-please/#findComment-125952 Share on other sites More sharing options...
LuckyBambu Posted November 17, 2006 Share Posted November 17, 2006 [quote author=doni49 link=topic=115271.msg469359#msg469359 date=1163731740]Have fun trying.[/quote]I'm sorry?Edit: Uploading to revver... crappy google video quality Quote Link to comment https://forums.phpfreaks.com/topic/27529-help-needed-with-php-url-rewrite-please/#findComment-125955 Share on other sites More sharing options...
doni49 Posted November 17, 2006 Share Posted November 17, 2006 OK that one is easy to explain. In windows you have "hide known extensions" turned on. Notepad adds the txt extension to a filename if you name it something else.i.e. if you use Save As and call it test.html, test.html.txt will be created. But if you enclose the filename in quotes (double--" not single--'), it'll use what you supply as the whole name. But this thing about STARTING the filename with a period is just FREAKY. Quote Link to comment https://forums.phpfreaks.com/topic/27529-help-needed-with-php-url-rewrite-please/#findComment-125956 Share on other sites More sharing options...
doni49 Posted November 17, 2006 Share Posted November 17, 2006 [quote author=gotit link=topic=115271.msg469367#msg469367 date=1163732476]One thing I don't understand is:when i creat the file past the code in it and then want to save as--- I simply past ".htaccess" in the file name with nothing following it.and this file shows as .htaccess on my pc, but once I load it it shows as ".htaccess.txt" on the server. Does that has to do anything with it.I also tried deleting that .txt on the server.I do have access to hosting control panel, but there is no option for me to creat a filethese are the options categories:DomainsE-mailWebMail Websites & ApplicationsWeb Space & AccessFTP AccountQuota Marketing Center Package Information Software & Downloads Order More Features [/quote]If they're that restrictive, they may very well have config'd their servers NOT to all the use of .htaccess files. Who's your provider? Quote Link to comment https://forums.phpfreaks.com/topic/27529-help-needed-with-php-url-rewrite-please/#findComment-125963 Share on other sites More sharing options...
LuckyBambu Posted November 17, 2006 Share Posted November 17, 2006 Got impatient, so I just uploaded it to Snapdrive. Everything else produced bad quality or took too long.http://www.snapdrive.net/files/195519/Gee%20Wiz%20Htaccess.aviThis will both correct doni and hopefully help the opener of the thread. Quote Link to comment https://forums.phpfreaks.com/topic/27529-help-needed-with-php-url-rewrite-please/#findComment-125968 Share on other sites More sharing options...
doni49 Posted November 17, 2006 Share Posted November 17, 2006 [quote author=LuckyBambu link=topic=115271.msg469385#msg469385 date=1163733909]Got impatient, so I just uploaded it to Snapdrive. Everything else produced bad quality or took too long.http://www.snapdrive.net/files/195519/Gee%20Wiz%20Htaccess.aviThis will both correct doni and hopefully help the opener of the thread.[/quote]Check page one, I already acknowledged that you were right. Quote Link to comment https://forums.phpfreaks.com/topic/27529-help-needed-with-php-url-rewrite-please/#findComment-125971 Share on other sites More sharing options...
LuckyBambu Posted November 17, 2006 Share Posted November 17, 2006 [quote author=doni49 link=topic=115271.msg469388#msg469388 date=1163734049][quote author=LuckyBambu link=topic=115271.msg469385#msg469385 date=1163733909]Got impatient, so I just uploaded it to Snapdrive. Everything else produced bad quality or took too long.http://www.snapdrive.net/files/195519/Gee%20Wiz%20Htaccess.aviThis will both correct doni and hopefully help the opener of the thread.[/quote]Check page one, I already acknowledged that you were right.[/quote]And this is why I should pay attention to edits. Sorry for not noticing, haha. Quote Link to comment https://forums.phpfreaks.com/topic/27529-help-needed-with-php-url-rewrite-please/#findComment-125973 Share on other sites More sharing options...
gotit Posted November 17, 2006 Author Share Posted November 17, 2006 [quote author=doni49 link=topic=115271.msg469380#msg469380 date=1163733161][quote author=gotit link=topic=115271.msg469367#msg469367 date=1163732476]One thing I don't understand is:when i creat the file past the code in it and then want to save as--- I simply past ".htaccess" in the file name with nothing following it.and this file shows as .htaccess on my pc, but once I load it it shows as ".htaccess.txt" on the server. Does that has to do anything with it.I also tried deleting that .txt on the server.I do have access to hosting control panel, but there is no option for me to creat a filethese are the options categories:DomainsE-mailWebMail Websites & ApplicationsWeb Space & AccessFTP AccountQuota Marketing Center Package Information Software & Downloads Order More Features [/quote]If they're that restrictive, they may very well have config'd their servers NOT to all the use of .htaccess files. Who's your provider? [/quote]1and1 is the provider Quote Link to comment https://forums.phpfreaks.com/topic/27529-help-needed-with-php-url-rewrite-please/#findComment-125983 Share on other sites More sharing options...
doni49 Posted November 17, 2006 Share Posted November 17, 2006 This is from 1&1's web site. It lists which of their packages supports using .htaccess files.http://faq.1and1.com/scripting_languages_supported/configuring_apache_server_using_htaccess/1.html Quote Link to comment https://forums.phpfreaks.com/topic/27529-help-needed-with-php-url-rewrite-please/#findComment-125988 Share on other sites More sharing options...
doni49 Posted November 17, 2006 Share Posted November 17, 2006 and take a look here as well.http://faq.1and1.com/scripting_languages_supported/configuring_apache_server_using_htaccess/4.html Quote Link to comment https://forums.phpfreaks.com/topic/27529-help-needed-with-php-url-rewrite-please/#findComment-125989 Share on other sites More sharing options...
gotit Posted November 17, 2006 Author Share Posted November 17, 2006 [quote author=doni49 link=topic=115271.msg469408#msg469408 date=1163736848]and take a look here as well.http://faq.1and1.com/scripting_languages_supported/configuring_apache_server_using_htaccess/4.html[/quote]This means we can use .htaccess in shared package. Does it? if yes why it's not working for me... :(code used:RewriteEngine OnRewriterule ^system/listing([0-9]+).html$ /system/listingView.php?listingCode=$1 Quote Link to comment https://forums.phpfreaks.com/topic/27529-help-needed-with-php-url-rewrite-please/#findComment-125991 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.