tim,
Yes, that’s your job when you create these bogus links.
Regards,
DK
tim,
Yes, that’s your job when you create these bogus links.
Regards,
DK
I am back dklynn, I still have all kinds of problems trying to correctly write a htaccess and this has been such a rollercoaster and learning experiance. But at the same time almost feels like a waste of time because with every Trial And Error… I Ended in error. I Just sent this msg to my server admin since he is the only other person i know who knows htaccess and this is what i told him. It is every aspect of what i am trying to do.
I Have a Image cms script running on my website and i have spent countless hours trying to shorten the URLS and make them SEO Friendly. I have Tried So many Differnt Mod-Rewrite Setups and still can not get it right after reading and searching and asking for help with this lol.
Ill explain everything from scratch.
I have www.myspace-help.com < - Main URL
First Page is the Main Catagory.
The ?page=1 is the Pagination it can go like ?page=2 and so on for how many pages there is.
ex. - www.myspace-help.com/Background/?page=1
When u go to the first main catagory u have a choice of looking into Sub Catagorys (they range from things like abstract, cute-wallpaper, my-birth-day, As folder names and then the /?page=1 pagination.
ex. - www.myspace-help.com/Background/guitar/?page=1
There is also About 13 Other Folders/Catagorys Useing this script.
www.myspace-help.com/Myspace-Icons/?page=1
www.myspace-help.com/Avatar/?page=1
www.myspace-help.com/Myspace-Online-Icons/?page=1
And inside those are also 100+ Sub-Catagories in each Main Catagory
www.myspace-help.com/Myspace-Icons/cute/?page=1
www.myspace-help.com/Avatar/cool/?page=1
www.myspace-help.com/Myspace-Online-Icons/pink/?page=1
After all of this I have a Veiw.php Script… Someone on
www.myspace-help.com/Background/guitar/?page=1
Choses
www.myspace-help.com/Background/view.php?cat=guitar&layout=guys-2.jpg
This is my Current Setup and it is only working 50% of the pages.
RewriteRule ^(.*)/(\d+)\.htm$ $1/?page=$2 [L,NC]
RewriteRule ^([a-zA-Z-]+)/([a-zA-Z-]+)/(\d+)\.htm$ $1/2$/?page=$3[L,NC]
RewriteRule ^([a-zA-Z-]+)-([A-Za-z0-9-]+)-(\d+)\.htm$ $1/$2/$3.htm [L,NC]
RewriteRule ^([A-Za-z0-9-]+)(\d+)\.htm$ $1/$2.htm [L,NC]
RewriteRule ^([a-zA-Z-]+)-([A-Za-z0-9-]+)-([A-Za-z0-9-_]+).(gif|jpg|swf|flv|png).htm$ $1/view.php?cat=$2&layout=$3.$4 [L,NC]
Problems i have right now with my htacess is if i have Folders like
/Background/Emo/ - /Background/Emo-Images/ - /Background/Emo-Layouts/
With this line
“RewriteRule ^([a-zA-Z-]+)-([A-Za-z0-9-]+)-([A-Za-z0-9-_]+).(gif|jpg|swf|flv|png).htm$ $1/view.php?cat=$2&layout=$3.$4 [L,NC]”
Only Emo will work the rest will 404. This failure also applies to my Sub-Cats alone.
Sometimes i can view
www.myspace-help.com/background-emo-1.htm But not
www.myspace-help.com/background-emo-images-1.htm
and with view.php sometimes ill be inside say /emo-images/ but trying to pull the url using my mod rewrite for view.php will return a 404 instead of the image. But on other images with the same circumstances. Also things like images named 4.jpg or myspace-icon-pink-1.jpg would just 404 for no reason when other images in the same cat work…
My Htacess is just plain bad!
Threw trial and error i did one thing on my side that should help out this htaccess Rewrite
I Renamed every single file and folder into lowercase, Use only - instead of _ Ever, And Renamed Everyfile after its sub-cat like /background/guitar/ would have images inside named “guitar-01.jpg” or “guitar-02.gif” All of my images are gif,jpg,png not just jpg or just gif.
But this is everything that is going on and i have spent way to long researching, reading, testing, even asking other forums and friends and im left with no currect htaccess seo url rewrite. Also i still dont fully understand how the [L] [NC] [R=301] [QSA] Mean or work or when they are needed. So if they look out of place, they are.
But Very long explination even shorter.
TLDR;
Ok
So This is what i have
www.myspace-help.com/Background/?page=1
www.myspace-help.com/Background/guitar/?page=1
www.myspace-help.com/Background/view.php?cat=guitar&layout=guys-2.jpg
How can i have
www.myspace-help.com/Background-1.htm
www.myspace-help.com/Background-guitar-1.htm
AND!!!
www.myspace-help.com/Background/view.php?cat=guitar&layout=guys-2.jpg
to any of these.
www.myspace-help.com/Background-guys-2.jpg
www.myspace-help.com/Background-guys-2.html / htm / php
www.myspace-help.com/Background-guys-2/
www.myspace-help.com/Background-guitar-guys-2.jpg
www.myspace-help.com/Background-guitar-guys-2/
www.myspace-help.com/Background-guitar-guys-2.html / htm / php
Anything close to one of those top 6
I Will forever be thankful if someone could kindly help me finnaly squash this problem!!!
Ok i rewrote a old one that worked and this works perfect
RewriteRule ^(.*)/(\\d+)\\.htm$ $1/?page=$2 [L,NC]
RewriteRule ^([a-zA-Z-_]+)/([a-zA-Z-_]+)/(\\d+)\\.htm$ $1/2$/?page=$3[L,NC]
RewriteRule ^([a-zA-Z-_]+)-([A-Za-z0-9-_]+)-(\\d+)\\.htm$ $1/$2/$3.htm [L,NC]
RewriteRule ^([A-Za-z0-9-_]+)_(\\d+)\\.htm$ $1/$2.htm [L,NC]
This correctly Makes all of my catagories and main cats perfectly i still can not figure out what to do with
http://www.myspace-help.com/Myspace-Backgrounds/view.php?cat=Animated-Backgrounds&layout=animated_7.gif
http://www.myspace-help.com/Myspace-Comments/view.php?cat=Autos&layout=auto1.gif
To Anything like
http://www.myspace-help.com/Animated-Backgrounds-animated_7.gif
http://www.myspace-help.com/Autos-auto1.gif
and you are extreamly knowledgeable. i appreciate you replying to this thread to help me. i have read threw your link and still haveing trouble learning. I have spent i guess a week now trying to perfect my htaccess so i can have my graphics script seo friendly.
The Last peice i need to the whole thing is
http://www.myspace-help.com/Myspace-Backgrounds/Abstract-Backgrounds/view.php?cat=Abstract-Backgrounds&layout=Abstract-1.jpg
im trying to get some sort of
http://www.myspace-help.com/Abstract-Backgrounds-Abstract-1.htm
# WWW Only
RewriteCond %{HTTP_HOST} !^www\\.Myspace-Help\\.com$ [NC]
RewriteRule ^(.*)$ http://www.Myspace-Help.com/$1 [R=301,L]
# http://www.myspace-help.com/Backgrounds/?page=1 to Myspace-help.com/Myspace-Backgrounds-1.htm
RewriteRule ^([a-zA-Z-_]+)/([a-zA-Z-_]+)-(\\d+)\\.htm$ $1/$2/?page=$3 [L,NC]
RewriteRule ^([a-zA-Z-_]+)/(\\d+)\\.htm$ $1/?page=$2 [L,NC]
RewriteRule ^([a-zA-Z-_]+)_(\\d+)\\.htm$ $1/$2.htm [L,NC]
# Catagory Rewrite
RewriteRule ^([A-Za-z0-9-_]+)-(\\d+)\\.htm$ Myspace-Backgrounds/$1-$2.htm [L,NC]
# View.php Rewrite
Is this ok or is this still a bad way to code it?
tim,
Okay, but you MISSED NOT HAVING (.*) at the start of your mod_rewrite. Please READ the post above again as it does have a lot of information between my rants. ![]()
Regards,
DK